[mypyc] Support disabling global optimizations (#7869)
Currently all of the global optimizations are based on the children
list, so the strategy here is to disable tracking that in separate
compilation mode. Consumers of that information then need to handle
this case.