ptr: split out borrowed pointer utilities

The ptr module is intended to be for raw pointers.

Closes #3111