Might be able to call this directly for `npy_intp`, it is in the sorting library.