When a corporation acts beyond the powers its state has granted, the act is ultra vires: outside the entity’s authority and void as a matter of law. The doctrine is older than the country.
So basically loopholes aren't a free pass if the effective outcome is ultra vires than the action will be void by law.
The ones that do work would effectively be zero day exploits that the state legislature could patch. I would also expect state legislatures to uncover some of these loopholes during the process and preemptively amend their bills to prevent them.