TYP: Make mypy 0.800 compatible
- [x] closes #39399
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
