c_str: replace .with_ref with .as_ptr throughout the codebase.
c_str: move `.unwrap` & document it more clearly.

This should be called rarely, but it was placed first in the list of
methods, making it very tempting to call.