I have seen various efforts to do this stuff in a way that is checkable via mypy (i.e. using Python's own type system + as much dynamism is still type-able) and so far it looks like it's a much harder task
These folks have several excellent projects in that direction though: https://github.com/dry-python/