CLN: Replace imports of * with explicit imports
Remove compat_NaT which is never used after being defined

Remove other unused imports

Remove unused cdef enum NPY_TYPES

flake8 cleanup in period.pyx

Ref #17234

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
