Fix Mypy static analysis problems
Fixes various smaller static analysis problems and runs Mypy as part of make test.
Also bumps Python development and runtime from 3.8 to 3.9.
Edited by Deaktivert bruker
Fixes various smaller static analysis problems and runs Mypy as part of make test.
Also bumps Python development and runtime from 3.8 to 3.9.