Throughout the recent turmoil in neighboring Iran, the Kremlin has maintained a careful public neutrality towards Shah Mohammad Reza Pahlavi despite the fact that his well-armed pro-Western country bolsters U.S. influence in the Middle East and buffers the region against Soviet encroachment in vital Persian Gulf oilfields.

This approach reflects the innate caution of the leadership of Leonid Brezhnev, plus worries over what a future without the Shah could mean for carefully developed relations with Iran. There is also a sense here - for the moment at least - that the Iranian sovereign may be solving the crisis that threatens to drive him from the Peacock Throne.

"The Soviets will be extremely cautious as long as it looks like the shah can survive," said one Western diplomat in what can serve as a summary of the views of many others. "They are not going to jeopardize their future relations with Iran."

Even so, in recent days sparse official government news dispatchers, using a favored tactic of quoting other news agencies, have criticized the shah's new military government as it seeks to restore order in the country and bring oil production back to normal. At the same time, the Soviets have begun contrasting the violent methods of the new government with the endorsement by the Carter administration in an obvious attempt to cast the Americans in a poor light.

Yesterday, example, Komsomolskaya Pravda, quoting Le Figaro of Paris, declared that "the U.S. is extremely sensitive to the attempts of the opposition at replacing the present Iranian regime. They fear that the liquidation of the openly pro-American regime will call into question the decisive influence of the U.S. in Iran's economy."

In a long, recent analysis, the influential weekly Liternaya Gazeta blamed Iran's present troubles in part on ill-conceived massive industrialization guided by increasingly corrupt government officials. It portrayed a bleak picture for a better life being sacrificed to bureaucratic greed.

Nevertheless, the criticism has been mild by Kremlin propaganda standards and criticism of the shah personnally has been avoided.

In normal timed Iran pumps 900,000 of its daily oil output of more than 5 million barrels to the United States, making it a tempting target for Soviet subversion. But Soviet policy, evolved after years of outright reversals and undermittent tensions, has aimed during the Brezhnev era at a general improvement of relations with Tehran. Despite occasional anger over such things as the visit to Iran this summer by Chinese leader Hua Kuo-feng, the Soviets have achieved a modus visendi with the shah that has endured in the face of temporary unpleasantness and his close ties to the United States.

Soviet policy evolved from repeated Czarist intervention in Iranian affairs. Just after World War II, Stalin was thwarted in an attempt to force major oil concessions and hang onto territory in northern Iran taken by the Red Army in the joint Anglo-Russian occuaption of Iran to safeguard the oilfields from the Nazis in 1941. Later Soviet agitation through the outlawed Tudeh Iranian Communist Party came to an end years ago after Moscow was outmaneuvered by the West. As a sop to the shah, Kremlin propaganda in recent years has rarely mentioned any leftist Iranian leader.

Iran today ranks as a major Soviet trading partner with trade turnover exceeding about $1 billion, at the official exchange rate, last year. This included half of Iran's raw cotton crop and virtually all its exportable natural gas, which the Soviets use to fuel industries in the Caucasus and Central Asian republics, while selling some of their own prodigious gas supplies to other countries.

There are several thousand Soivet technicians and advisers in Iran, helping on such major projects as the Isfahan steel complex, where 750,000 tons of steel are produced annually, a new alumina plant, several major hydro-electric projects, and gas-pipelines.

This is all part of the continuing effort by the shah to modernize his backward country and maintain good ties with Moscow as a continuing wedge against pressure from the West that could isolate him against the flank of an overpowering neighbor.

But all this economic activity is subordinate to the Kremlin's political interest in Iran, one of the "two pillars," with Saudi Arabia, of American Middle East policy that has stymied Soviet efforts at major penetration from the north of the strategic Persian Gulf area.

Yet trouble for the pro-Western, anti-communist shah may not be all that appealing to the Kremlin. The possible alternatives appear to be a military junta, that would in all liklihood be even less friendly to Moscow, or the formation of a radicalized Islamic republic of religious traditionalism, such as is being called for by the Shiite Moslem leader Ayatalloh Ruhollah Khomeini.

The presence of a magnetic Moslem holy man, such as the Ayatollah, issuing calls for renascent Islam from the capital of a major neighboring state could find a receptivity among the Soviets' own large Moslem populations of Central Asia and the trans-Caucasus that would be worrisome to Moscow.