There are costs, and there are related costs
People tend to think of only immediate costs. This is a mistake. For example, as Andy Grove will tell you, there is tremendous value in knowing how things are actually manufactured when you are designing things to be manufactured, even if most of the work is done overseas. Trying to figure out if the idea you have will scale into something big requires you to consider something beyond the mere invention of a thing, and to figure out how to scale that thing to production. I know in semiconductors that the US has lost a tremendous advantage in having an intimate knowledge of how things are done as most of the fabs have gone overseas or to foreign investors.
And that is without considering just what a shooting war in Taiwan would do to semiconductor supplies worldwide, and the impact it would have on the US's technology dependence. It seems to me that tariffs and other costs would be the equivalent of an insurance policy against rogue nations. After all, China not too subtly threatened the US drug supply when the US criticized the CCP's handling of the recent virus.