Fix mypy erroring on backport branches
see #48235

cc @twoertwein 

Any suggestions on how to deal with this more effectively?
Seems like the rounding issues with he Timedelta test are back The goal of this if condition is to exit early if a non-dev version of pandas is installed: we could simply change it to `if not getattr(pd, "__version__", "")` to require any installed version. I belief that should work for the CI.

Luckily, stubtest is in the manual stage of pre-commit, so it isn't run by default. The above change would only affect people running pre-commit on the manual stage. If a contributor has non-dev pandasinstalled, stubtest might find discrepancies between the stubs and the non-dev implementation and therefore fail. Personally, I would do the above change and add a comment here
https://github.com/pandas-dev/pandas/blob/main/doc/source/development/contributing_codebase.rst#validating-type-hints

```sh
# the following might fail if the installed pandas version does not correspond to your local git version
pre-commit run --hook-stage manual --all-files
# if the above fails due to stubtest
SKIP=stubtest pre-commit run --hook-stage manual --all-files
```

(I didn't double check whether that is the correct syntax for skipping a hook in pre-commit) This is the correct syntax, thx.

Like this? Could also explain in text, not as comment cc @mroeschke  Thx, will open an issue. 

I think we can merge? Typing is already green Awesome, thanks @phofl and @twoertwein 