Effectively, this is not very different from having two different languages in the first place. With dynamic vs. static typing, you also generally want different standard libraries and language features, because those are two different modes of programming that can benefit from different affordances. For example, in a statically-typed language you might have function overloading. This wouldn’t work in a dynamically-typed language, or would have different semantics because it would dispatch on the runtime type instead of the static type. Meaning your proposed compiler switch would change which function is invoked.