Afaik all that gain comes from `bincount` over `_histogram`. Removing dicts only serves to make the code easier to read and about 5 lines shorter.