Take the case of F-35, the only country which has source codes apart from the U.S. is the UK. A very special exemption. They are also the only Tier 2 partner.
Everybody else has basically a black box of code given to them in terms of code for the aircraft.
Welcome to Weapon Platforms as a Service. We can provide you with the newest toys at a bargain price, but you can't modify anything, and we reserve the right to remotely brick the hardware whenever we like. Because what else you're going to do? Spend many years and billions of dollars on building your own? While your neighbor just leased 20 fighters from us?
How true is that for other countries' aircrafts? I'm somewhat skeptical of your claim to be honest, seems like a easy decision to not buy at all- there is no knowing ehat teams would form in the kind of war that would need these aircrafts at full scale.