CLN, STYLE: remove unused variables and imports in Cython files
- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Tried putting together a little Cython linter, here's the unused variables/imports it finds. More to come, but this already cleans up quite a few things
Great cleanup @MarcoGorelli!  It would be interesting to know why a lot of these unused variables don't get picked up via build warnings I think the build warnings just pick up unreachable code Gcc/llvm should warn for unused variables with the flags we have (-Wunused-variable us part of -Wall). My guess is Cython is generating code that still "uses" these variables and prevents that from happening. Likely hard to fix but in an ideal would that wouldn't happen in the first place 