ENH: add max fastpath to partition for nan detection

Allows low overhead check for NaN via isnan(partition(d, (x, -1))[-1])