Fix F841 - Unused variables (#16877)
Summary of the issue:
NVDA's code contains unused variables, with specific directives for the linter to ignore them (#noqa F841)
Description of user facing changes
There is no more #noqa F841 directive in the code.
Description of development approach
Searched for F841 in the code and solved the situations:
Generally, removed the unused variable and checked that its presence without any use was not due to another oversight to use it elsewhere
Or keep the previously unused variable and use it where it was aimed to (e.g. in NVDAObjects/window/_msOfficeChart.py)
In winConsoleHandler.py, renamed consoleEventHookHandles to consoleWinEventHookHandles since the goal clearly seems to empty the list.
Also used a Flake8 report on an older version of NVDA to identify other F841 issues. This way, I have been able to find undefined private variables (i.e. starting with underscore) that are not caught by Ruff's default rule.