TYP: Fix typehints for ExtensionDtype
This is a fix for type hints of `ExtensionDtype`. `register_extension_dtype` was confusing pyright autocomplete. It was fixed by parameterizing its return value on its input value.

Example:

```python
import pandas as pd

pd.CategoricalDtype(categories=['a', 'b'])
```

Before this change:
```console
$ pyright --version
pyright 1.1.133
$ pyright --lib pd.py
No configuration file found.
No pyproject.toml file found.
stubPath /home/omer/src/ext/typings is not a valid directory.
Assuming Python platform Linux
Searching for source files
Found 1 source file
/home/omer/src/ext/pd.py
  /home/omer/src/ext/pd.py:3:1 - error: Expected no arguments to "ExtensionDtype" constructor (reportGeneralTypeIssues)
1 error, 0 warnings, 0 infos
Completed in 0.72sec
```

After:
```console
$ pyright --lib ../pd.py
No configuration file found.
pyproject.toml file found at /home/omer/src/ext/pandas.
Loading pyproject.toml file at /home/omer/src/ext/pandas/pyproject.toml
Pyproject file "/home/omer/src/ext/pandas/pyproject.toml" is missing "[tool.pyright] section.
stubPath /home/omer/src/ext/pandas/typings is not a valid directory.
Assuming Python platform Linux
Searching for source files
Found 1 source file
0 errors, 0 warnings, 0 infos
Completed in 0.777sec
```
 pyright was yelling at me that `return dtype_type.construct_from_string(dtype)` actually returns `ExtensionDtype` from `find`. I tried fixing it while I was at it but reverted back later since it broke things elsewhere with mypy. This part should be irrelevant to the rest.

https://github.com/pandas-dev/pandas/blob/ac2e3e6570d19c31041b75244f6b3a9853d15f9e/pandas/core/dtypes/base.py#L427

This should be ready for review if it passes CI. This is a very minor change but it helps removing `# type: ignore` in some cases with extension dtypes in the user code, keeping type checker and autocompleter happy. cc @simonjayhawkins @Dr-Irv  lgtm @Dr-Irv register_extension_dtype was not giving pyright warnings in #39501? > lgtm @Dr-Irv register_extension_dtype was not giving pyright warnings in #39501?

@simonjayhawkins 
I may have been using an earlier version of pyright.  But I think it would be better to merge in #40421 and then see if this PR is needed, because #40421 handles many `ExtensionDType` things. #40421 has conflicts and needs a merge master anyway. let's get this one in. Thanks @ozars small targeted PRs for adding/refining type annotations always welcome.  Thank you.