Can you explain how you mean this? Obviously, it helps if the knowledge of the codebase is with a trusted partner. But taking as an example Grist (https://getgrist.org), which is developed by a NY-based US company and is part of the French La suite numérique (LSN). Should a geopolitical reason get in the way of Grist devs further collaborating with LSN, don't you think that France's sovereignty is safeguarded by the availability of the code?
Granted, it'd be a setback. But nothing a couple of dedicated French devs could not tackle.