Sorry, that was my point. Strengthening the types in python3 solves the problem without static typing being needed at all.
Static types solve it earlier though, especially for little-exercised code paths which could be forgotten or missed in testing.