In fact, max_val+1 is the default value for minlength, so this function is like `np.bincount(indices)` (minus the fact that bincount doesn't provide an `out` argument`. On top of checking 1D-ness and arrays that can be safely cast to integers, `bincount` also checks for negative values)