Add mypy checks.
mypy checks have been added to the gitlab pipeline. They can be triggered via `make mypy`. Some (minor) fixes to error checks are inlcuded.
T293382-add-typing2 jobs for
|test-ima||Test||There has been a timeout failure or the job got stuck. Check your timeout limits or try again|