CLN: prepare unifying hashtable.factorize and .unique; add doc-strings
For adding a `return_inverse`-kwarg to `unique` (#21357 / #21645), I originally didn't want to have to add something to the templated cython code, preferring to add a solution using `numpy.unique` as a first step (with the idea of improving the performance later).

@jorisvandenbossche then remarked:
> Which led me think: `pd.unique` with a `return_inverse` argument is actually basically the same as `pd.factorize`?

I didn't know what `factorize` was doing, so I had no idea about this connection. From looking at the cython code in `hashtable_class_helper.pxi.in`, I found that there's substantial overlap between `unique` and `get_labels` (the core of `factorize`) - the only difference is the handling of `NaN/None/etc.`

I think that these could/should be unified for less code duplication. Alternatively, the first commit of this PR could be split off into a separate PR - it is *just* adding a `return_inverse`-kwarg to `unique` -- though effectively by duplicating the `factorize` code.

Both variants pass the the test suite locally, the only question is whether there's appreciable differences in the ASVs. Since the only extra complexity of unifying the code is reading the value of some `bint` within the loop, I don't think that it'll be relevant. I got some noisy data the first time 'round, will let it run again when I have the possibility.

So long story short, this PR prepares the hashtable-backend to support `return_inverse=True`, which plays into #21357 #21645 #22824, and will also allow to easily solve #21720.

Side note: this already builds on #22978 to be able to run the ASVs at all.