Extend check for inconsistent pandas namespace usage
xref #38076 - it can probably be extended beyond checking for classes.

Steps would be:

1. change `PATTERN` in `scripts/check_for_inconsistent_pandas_namespace.py` to
```
PATTERN = r"""
    (
        (?<!pd\.)(?<!\w)    # check class_name doesn't start with pd. or character
        (\w+)\(        # match DataFrame but not pd.DataFrame or tm.makeDataFrame
        .*                  # match anything
        pd\.\2\(            # only match e.g. pd.DataFrame
    )|
    (
        pd\.(\w+)\(    # only match e.g. pd.DataFrame
        .*                  # match anything
        (?<!pd\.)(?<!\w)    # check class_name doesn't start with pd. or character
        \4\(                # match DataFrame but not pd.DataFrame or tm.makeDataFrame
    )
    """
```
and save.

2. run `pre-commit run inconsistent-namespace-usage --all-files`, check the error messages, and fix them up

Here are the files which need fixing:
```
- [ ] pandas/tests/arrays/floating/test_to_numpy
- [ ] pandas/tests/extension/decimal/test_decimal
- [ ] pandas/tests/io/test_sql
- [ ] pandas/tests/series/test_constructors
- [ ] pandas/tests/arrays/test_datetimes
- [ ] pandas/tests/frame/test_stack_unstack
- [ ] pandas/tests/arrays/boolean/test_comparison
- [ ] pandas/tests/internals/test_internals
- [ ] pandas/tests/arrays/masked/test_arrow_compat
- [ ] pandas/tests/reshape/merge/test_multi
- [ ] pandas/tests/indexing/test_datetime
- [ ] pandas/tests/scalar/timestamp/test_unary_ops
```

This can probably all be one in a single PR.

3. To check you've fixed up a file completely, running
```
pre-commit run inconsistent-namespace-usage --files <file.py>
```
should return "PASSED".