The Mandarin first appeared in the Iron Man comic books in 1964. He was a Chinese Imperialist kicked out of power after the 1949 Communist revolution, who then spent his time in exile trying to come up with ways to return to power. His power-hungry plans got a big boost when he discovered 10 magic rings that gave him superpowers in the wreckage of a spaceship.
Yet in Iron Man 3, The Mandarin (Ben Kingsley) appears as an Islamic fundamentalist orchestrating a mass bombing campaign in Kuwait and across the United States. The Chinese history has been completely ditched. It will perhaps come as no surprise, then, to learn that Iron Man 3 is the largest Hollywood movie to be co-produced by China to date. The changing of nationality is a political move that should come as no surprise, given Hollywood's history of following the contemporary political climate when choosing the nationality and backstory of movie villains.
The Germans were the whipping boys after the Second World War. The Russians were forever coming up with dastardly plans during the Cold War. The Japanese were bad guys during the car and computer manufacturing wars of the 1980s. More recently, it's been the turn of the Arabs and Islamic terrorists. The post-September 11 stereotyping of Arabs was frequently criticised by Emirati audiences.
However, the capture of Osama bin Laden and the military failures in Iraq and Afghanistan, combined with the Middle East becoming a plentiful source of financing for Hollywood movies through companies such as Image Nation (owned by Abu Dhabi Media, which also owns The National), has seen a change in the landscape. It's a change acknowledged by Iron Man 3 director Shane Black, with a hilarious twist in the movie: without giving too much away, the "war on terror" is shown up to be part of a massive media war.
The other rule of thumb is that Hollywood will not want to offend a country that it sees as a valuable marketplace. This can most clearly be seen with China. As China's influence began to emerge, Disney even secretly hired former Secretary of State Henry Kissinger to fly to Beijing and help smooth over relations before the 1997 release of Kundun, Martin Scorsese's film about the Dalai Lama. It was an action that would not have been dreamed of in the days Goldfinger was giving Bond the run around.
China has become one of the most important international markets for American films and that's despite a trade embargo that limits the number of American films that can be released in Chinese cinemas to 34 a year. In the recent remake of the 1984 action movie Red Dawn, references to a Chinese invasion were removed in the editing suite, where the villains became the North Koreans, the new bête noire of Hollywood. The vilification of North Korea started in Team America (2004) and is on the increase, most recently in Gerard Butler's action flick Olympus Has Fallen, where North Koreans take over the White House.
The trouble is that with the international marketplace becoming increasingly important, Hollywood may still run out of countries to vilify. There is, of course, always the default of the British villain - the exception that proves the rule.