I don't understand what you mean by "But in a rare code path, that may not to be triggered." Can you explain?
I wasn't suggesting using tests; I was suggesting using asserts. Directly in the function that is type sensitive. If that function is ever called with an incorrect type it will throw an exception.
I get the benefit of optional type checking without a compile step in development like with Flow.