Fix issues found by flake8-bugbear: * Unused loop variables * assert statements in non-test code * mixing test code with production code * mark one excessive test which takes ~10min to run as 'slow'
Remove byte-order-marker pre-commit check as there would be many adjustments necessary
Spaces tend to cause annoyances in a Unix-style shell environment. This change fixes that.