Use tariffs on IP
The way to do it with minimal other effect such as effects on normal small businesses trading across borders, but not playing tax games, is to put a tariff on imports of IP (licensing on patents, trademarks, brands etc) at least equivalent to the corporation tax rate.
Currently, a tax-sharp company ensures places ownership of IP in a low tax country. The local subsidiary, actually doing the selling or work, is cross-charged a licence for that IP (ie imports it). So $1,000 of sales. $500 of normal costs. And then they create a licence fee for the brand or patent rights of $500. That's then $1000 of cost, and so $0 of profit in the subsidiary. $500 of profit moved out to the low tax country as licence fees.
A tariff on the IP fees heading out of the country would effectively tax the funnel so that business can't use this to maximise costs in order to avoid tax, so say 20% tariff on the IP which means 20% of $500 collected - exactly equivalent to as if the IP had been held locally.