Who enforces this? Elon can just say he refuses to follow any gov mandates. If they try to penalize or jail him, he is going cause a massive uproar from the public that will prevent any such shenanigans. Power is in people that follow you.
I think you overestimate the proportion of people on Earth who are in favor of Elon being held above law and international treaties. Personally I certainly think it would be appropriate for a state to act against a citizen who was violating a treaty that the state had signed.