They don't necessarily have to: there's another, more comprehensive hammer they (or the US for that matter) could use: disallow vertical integration. Force hardware vendors to only sell hardware. If any software that can be changed remotely or by the user is off limits. Even firmware. Conversely, software vendors can only sell (or freely distribute) software. For vendors from abroad, don't go extra-territorial, just…
There is precedent for this idea, in 1948 the Supreme Court forced the film studios to give up exhibition (theaters) with the paramount decision. This enabled the rise of independent film, and audiences benefited from more choice.
If you try to do this legislatively the Apples and the NVidias of the world will hire an army of lobbyists and storm Capitol Hill. But it might be to their benefit. After the breakup of Standard Oil, John Rockefeller became richer because competition forced out the less efficient portions of his old business from the market.
It’s true that it could temporarily degrade the user experience of some people, but that’s a small price to pay. People who give up liberty for safety, deserve neither liberty nor safety.