ENH: implement `digitize` with `PyArray_SearchSorted`

Closes #2656 and replaces #4184.
The return is of the same shape as `x`, which is the standard `searchsorted` behavior. We can restrict this to 1D arrays if there is a convincing reason for this, but it seemed unnecessary to me.