Recent developments continue to add mounting evidence to the proposition that this is not the case and that the leadership in Tehran is not governed by an iron-clad ideology, but by a desire for survival (and the power needed to ensure survival) in the meat-grinder that is domestic politics.* Most recently, Ahmadinejad was rumored to have denounced the brinksmanship that Iran has engaged in over the Persian Gulf. The Telegraph asserts that:
Mr Ahmadinejad claims the supreme leader's loyalists are deliberately provoking a confrontation with the West to make him look weak, thereby undermining his supporters' prospects in elections to the Majlis... (The Telegraph)This would provide a tempting explanation for the statements by figures like Gen. Safavi which, to all involved, appeared to be setting Iran up to lose face after being forced to back down from impossible positions (i.e. refusing to allow a USN carrier to reenter the Persian Gulf); in other words, to paraphrase John Limbert, it was a product of maximalist rhetoric painting the leadership into positions they could never hope to defend.
If this source is to be believed however this was not an accidental occurrence, but a concerted effort to sap Ahmadinejad's political capital leading up to the 2012 Majlis election. Indeed, Khamenei may be attempting to restrain an unpopular (among elites anyway) Ahmadinejad in order preserve the tenuous balance of power which sustains the legitimacy of the political sphere. The Supreme Leader's goal is not to publicly exclude Ahmadinejad or his allies from participation in they system because doing so would have much the same effect as the boycott by certain reformist candidates is intended to achieve - demonstrate to Khamenei that he (and by extension Velayat-e Faqih) no longer have the consent of the population to govern. In this manner, it's essential for the current alliance between traditional conservatives and principlists to actually deprive Ahmadinejad of his support at a popular level, and among key power nodes.
In this scenario, escalation could have several purposes. Sabotaging the economy by way of international relations would have negative consequences for Ahmadinejad who is already suffering significant public relations flak for his handling of the economy - the number one issue to many voters in the coming election. This option would also simultaneously be privately attractive to many key IRGC-aligned figures close to the Suprme Leader who could use the opportunity to consolidate their own 'grey-market' patronage networks. It seems short-sighted to believe however that this strategy will function without blowback for Khamenei; Ahmadinejad may be blamed in the short-term for the state of the economy, preventing him from using his faction to successfully balance against Khamenei, but it may be a Pyrrhic victory if it comes at the cost of heightened tensions, and an a sluggish economy overall. Furthermore, because Khamenei essentiallys offers no real alternative to this strategy it may eventually end up delegitimizing him as well in the end.
Alternately, it could function as a form of brinksmanship within Tehran. Khamenei may be gambling that when Iran is eventually forced to backdown from its 'impossible positions', then Ahmadinejad would be saddled with the blame for "bowing to foreigners intent on dominating Iran" - a common refrain in domestic factional warfare.
Maybe some other dynamic is at work here?
* It should be noted that this is not to say that Iran is a purely rational state governed by formulaic calculations of power; they are still subject to the influence of ideology and the threat of miscalculation. This is far from a unique problem as all nations suffer from it to some degree and while it may weight the calculations one way or another, it can never negate the calculations altogether. Even if Ahmadinejad (or any politician) has come to the conclusion that his interest lies in avoiding conflict, it must be remembered that this is still only just a means to an end. In this case, the end is a revisionist redistribution of power towards a global multi-polar world.