The captain of the marine salvage ship Odyssey complained about this system on one of the Treasure Quest TV episodes because it allows competitors and amateurs to know the location of his ship. He has to employ countermeasures, such as not staying over the location of a promising site for too long. That suggests it cannot legally be turned off.
"Ships fitted with AIS shall maintain AIS in operation at all times except where international agreements, rules or standards provide for the protection of navigational information."
Yes, but in international waters there are no real sanctions, and no patrols to check. When closer to shore it sometimes gets checked, but in my experience very few vessels are caught, and even fewer are fined, if their AIS is simply off.