Reconcile C API with docs

This fixes #5286 and results from discussion on that issue.
Wouldn't `npy_intp` be safer? The format code for that type is `NPY_INTP_FMT`.