Expand flake8 coverage and fix fallout
As per #181 (closed), the CI was only linting Python files in PyConf. This MR expands the linting job to cover all Python files in Moore, and fixes the fallout to get the CI green. The commits are broken up into per-error changes.
The linter pointed out a couple of things I found a bit suspicious, so will ping the relevant folks in the diff to see if more scrutiny is needed.
It would be cool to have these checks run as pre-commit hooks when developing locally. I think LHCb!2647 (closed) works towards addressing that.