[lint] Fix remaining variables shadowing python builtins and enable detection of shadowed variables going forward
Summary:
This is the last step cleaning up variables shadowing python builtins. Going forward the linter will catch these and report an error.
Depends on D13748, D13749, and D13750
Test Plan:
ninja check-functional
From project root:
flake8 | grep A001
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D13751