ENH: implement `digitize` with `PyArray_SearchSorted`

Closes #2656 and replaces #4184.