CLN: Remove unused functions/variables
Found by pyright's `reportUnused*`.

Unused functions/variables are not directly related to typing, but pyright warns about these cases because it is asked to do unnecessary work.