CLN: make CategoricalIndex._create_categorical a classmethod
State: closed

Currently, ``CategoricalIndex._create_categorical`` is a staticmethod, and is being called internally using *either* instances or classes as its first argument, e.g.:
* in ``_is_dtype_compat`` *an instance* is supplied as the first argument,
* in ``__new__`` *a class* is supplied as the first argument.

This is confusing and makes the code paths different depending on how the method is called. It makes it difficult to reason about the precise output of the method.

This PR cleans this up by making ``_create_categorical`` a classmethod. This simplifies stuff, and we can also remove the method's first parameter when calling it.

Calling ``_create_categorical`` unneccesarily is one reason for the slowness of #20395. After this cleanup PR I will do another that should get #20395 come down to 1.6 ms as well as give some other related performance improvements.

Labels:
name: Categorical
description: Categorical Data Type
name: Clean

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21618?src=pr&el=h1) Report
> Merging [#21618](https://codecov.io/gh/pandas-dev/pandas/pull/21618?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/4922c0e0ab7044b8ed85299800e2efaf88035500?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/21618/graphs/tree.svg?token=eZ4WkYLtcO&width=650&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/21618?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #21618      +/-   ##
==========================================
+ Coverage    91.9%    91.9%   +<.01%     
==========================================
  Files         153      153              
  Lines       49547    49548       +1     
==========================================
+ Hits        45537    45538       +1     
  Misses       4010     4010
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.3% <100%> (ø)` | :arrow_up: |
| #single | `41.77% <66.66%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/21618?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/21618/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.63% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/category.py](https://codecov.io/gh/pandas-dev/pandas/pull/21618/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9jYXRlZ29yeS5weQ==) | `97.28% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21618?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21618?src=pr&el=footer). Last update [4922c0e...fa378e2](https://codecov.io/gh/pandas-dev/pandas/pull/21618?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Comments addressed & green
thanks @topper-123