ENH: implement `digitize` with `PyArray_SearchSorted`

Closes #2656 and replaces #4184.
probably not really significant but also does no harm, there is a macro that only releases it if a counter is higher than 500 to avoid unnecessary overheads, that can be used here.