``bincount`` can't work with arbitrary labels or even negative integers. Converting to integer classes takes a longer time than just calling ``_histogram`` (the ways I've tried).

Do you just not want a dict returned? It makes the many class labels case 2x slower your way.