People should resist the temptation to defend this. 1. Blocking Iranian IPs, as opposed to accounts, is almost certainly over-compliance. Note that the vast majority of websites do not do this. Even big ones, such as Gmail, do not do this. 2. It does not speak well of the United States justice system if someone could be prosecuted for failure to block Iranian IPs. If this were required, the law should be clear. Other…
Do you have a source for this being over-compliance? Gitlab and Github are both actively sharing technology. It's not like Gitlab randomly decided "Hey let's block Iran today", obviously they have in house legal council who advised this course of action.
With regards to your second point, everyone knows there are sanctions on Iran, it's been all over the news, and besides it's not like Gitlab is a random US citizen. They are a big company that is doing business overseas. It stands to reason that they should be aware of all laws and restrictions on international trade.
I think it's the other way around, companies like Google and Facebook should grow some responsibility, it is not unreasonable to ask a company to "fish" for any accounts that conflict with any laws. Google and Facebook might give the impression that it's hard, but it's really not, it's only hard if you expect to make hundreds of dollars for every dollar that you invest acquiring your user base.