Is that US law or international law?
Light investigation says it is selectively applied for national security. So... pretty big loophole.
This is true. The US gets creative when it wants to avoid adhering to the law. But international law is established through treaties, and the terms the US agrees to in treaties is US law.
Which according to your source the President is allowed to disregard within his "constitutional authority". A can of worms on its own.
It's one of the reasons why for a lot of the "everybody joins" treaties, a bunch of countries sign with a statement that they don't recognize the US as a signatory.