Run mypy, flynt and isort on devtools. Now we use the sames `excludes` as for other linters (flake8, autopep8)
Add some type annotations to stay close to the source material, even if `mypy` does not flag any errors when I run it.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/20451 | core#20451]]