There are inbuilt software safety for export versions. Which restrict the use in ways that exporter country may not prefer. But you can't downgrade the hardware and also call it true 5th gen. For example, there was a official talk of USAF buying off Turkish F-35s with some additional software modification contract. That means, Turkish F-35s has the same central processor, radar, EOTS, DAS, EW suite, LO characteristics & engine that USAF original F-35s has.
Options are endless with software. F35s could always be secretly waiting a remote signal to shut down their engines. You can protect plane against reverse engineering by military encryption and by completely removing most critical pieces of code from planes and make planes run main server dependent. Like they do with F-35s.You can cancel all of the supposed stealth by simply using a software triggered radio locator. It could give away its location with periodic encrypted multi-channel pings when plane is airborne. It is impossible for us to know or decompile tens of millions of lines code to catch that trojan horse. That is why we can not trust any foreign, especially cleverly deceptive American equipment. Even Microsoft can not make Windows inaccessible to American government according to Edward Snowden. What makes you think they will not do 1000 times worse with all their military exports not just F-35s. This is why our Viper purchase is a huge mistake.
Why should we never trust west especially America?
People of our so called NATO "allies" were begging Putin on all social media to "Please nuke Türkiye and take Constantinople back" after 1 Russian plane was shot down.
America, Germany etc. left NATO bases in Türkiye immediately.
Took Patriots with them, left us all open to Russian attack. Retaliation started with Russia giving PKK, MANPADs and PKK killing one of our helicopter pilots with that.
More was coming, for sure. It was THAT serious. Erdogan had to apologize to Putin and Russian pilot's family in person and had to fire PM Ahmet Davutoğlu for giving the order. All to save us from Russia's further retaliations.
So that is NATO the NATO that even now after we bent the knee on Sweden STILL embargos us. Even with closed source code Eurofighter and countless other critical national security technologies that our "allies" don't want us to have.
In Short: Even if it is a toy that you are buying from America, west, BUYER BEWARE!
PS: I am a hacker and a software engineer myself.