I know of no such law. Civilian vessels, commercial or not, often carry weapons for their own defense. The only problem is compliance with whatever laws there are in the ports where they call.
When I did boardings merchant or otherwise, in international waters, our first question for the master was always "where are your guns" not "do you have...". Some company-owned vessels didn't have any, but many did. I don't recall a single privately-owned vessel that was unarmed in open sea.
Mostly I think vessels, if unarmed, are so by corporate policy, not any law. Many of them don't entirely trust their own crews (and if you've seen some of these crews you might agree). Up till now I would suppose that the insurance risks of armed crews have been a big problem. It could be, though, that this could be changing, and soon. For Blackwater-type protective contractors it could be a real good time to be in bidness.
i think there is a law against private owned vessels carrying firearms in the suez canal.
Armed resistance by determuined crew would interfere.