Here's a 2012 law review article (which I haven't read, yet), "Information Wants to be Free (of Sanctions): Why the President Cannot Prohibit Foreign Access to Social Media Under U.S. Export Regulations", https://scholarship.law.wm.edu/cgi/viewcontent.cgi?article=3...
Arguably, Microsoft and Github are simply choosing to participate more strictly than what is legally required--including what's constitutionally permissible for OFAC to enforce. And of course that's the problem with these large, centralized, free services. They can kick people off whenever they want whether it was legally required by law or not, and they will because they're going to be very risk averse in situations where they're not directly deriving revenue. There are many other areas where corporations, in the pursuit of profits, play fast & loose with the law in the face of far greater potential fines and liability.
Although it may not have a legal obligation under the current menu of precedents, I disagree that it has no obligation tout court.
The real facts on the ground here are that a person's website was censored at the behest of the US Government. This is chilled speech. That the target happens not to be a US National, and also a national of a nation under sanction by the US government does not put it outside the realm of speech.
> The United States government has no obligation to care about the collateral silencing of non-citizen speech in a foreign country subject to economic sanctions.
You have inverted the “care about”: if they simply did not care, it would be fine, as they wouldn’t be interfering with anyone’s rights. However, they are caring quite a lot, in the sense that they are willing to use violence to enforce these prohibitions.
The government also has a mechanism where someone inadvertently impacted by sanctions can appeal to the Treasury Department and be granted an OFAC "license" that gives them permission to operate outside of the sanction(s). If the goal is to silence those who are subject to the sanctions that would be an odd way to do it.
[1] https://www.law.cornell.edu/cfr/text/31/part-589