In that case they will dump it at sea, and then use a cleaner fuel to dock.
Yep. That is the one completely unstoppable and unavoidable loophole. It would be completely impossible to prosecute for this. It's too bad.
Sooner or later some large country with a lot of land near the equator is gonna have enough climate related problems that they start solving that particular problem with sniffer drones and torpedoes.
Most of these big ships (at least container ships as far as I know) already use different fuels: cleaner fuels where it’s mandatory (close to borders) and cheaper/dirtier fuels on big seas.