Iran's President Abol Hassan Bani-Sadr is the only major public figure in Tehran who has consistently gone on public record as opposing the detention of American hostages from the very start.

But that does not make him a friend of the United States.

Indeed, he is an implacable foe of both superpowers, as his denunciations of the Soviet Union and the United States show.

At 46, he is an ardent Iran-firster -- convinced his brand of reform can wed late 20th century economics with the 7th century precepts of the Koran. Nothing better symbolizes his faith and determination than the computerized Koranic references to economic questions he had compiled.

His resentment against U.S. cultural, economic and political influence is deep-seated. It is based on a conviction that the United States, as the Western standard-bearer over a quarter century, profoundly violated traditional Iranian religious and social values by pushing for radical change in Iran.

His stand on the hostages is equally unambiguous. Alone among Iranian public figures, he boldly espouses the view that the Vienna conventions governing diplomatic relations must be honored.

His outspoken criticism of the hostages' detention -- including saying so to their radical Islamic student captors inside the U.S. Embassy compound -- cost him the Foreign Ministry only three weeks after he was entrusted with that portfolio following the Nov. 4 seizure of the embassy.

He was accused then of being too soft. Plans for him to travel to the United Nations to seek a settlement were canceled at the last minute and his arch rival, Sadegh Ghotbzadeh, replaced him at the Foreign Ministry.

While still foreign minister, he wistfully recounted to reporters that the radical students had telephoned his home to inform him they were contemplating seizing the embassy.

A friend answered the temephone, did not take the students seriously and, rather than disturb Bani-Sadr, said he was out of the house, he recalled. "That's fate," he remarked. "I certainly think I could have talked them out of it."

His opposition to the embassy takeover is also rooted in the conviction that revolutionary Iran is too disorganized to tackle more than one pressing problem at a time.

That does not mean he is unsympathetic to the students' basic aims, despite his increasingly open criticism of their efforts to challenge his presidential authority at the outset of his term of office.

Rather, there are differences of approach. What the students think they are accomplishing at the embassy by humiliating the United States in Iranian eyes, Bani-Sadr wants put into policy and practice.

He had made no secret of his desire to have Western Europe and Japan replace the United States as the principal foreign influence on Iran. At the same time, he has expressed private doubts about their willingness -- or ability -- to do so.

His suspicion of the superpowers reflects traditional Iranian nationalism. Russia and Britian divided Iran into spheres of influence -- and, indeed, occupied the country militarily off and on -- over the past hundred years.

After the Central Intelligence Agency helped overthrow the nationalist government of premier Mohammed Mossadegh in 1953 and put shah Mohammad Reza Pahlavi back on the throne, the United States replaced anti-Britain resentments.

Fifteen years in exile in Paris to escape the shah's post-Mossadegh repression added another lay to Bani-Sadr's distrust of the super powers. His stay in France coincided with the zenith of the late general Charles de Gaulle's influence among Third World intellectuals.

His message rejecting both U.S. and Soviet hegemony found a ready audience with Bani-sadr, who also was deeply influenced by Paul Vieille, a radical French theoretician of development economics.

A French friend recalled visiting Bani-Sadr's home in the early 70s -- long after Gaullist Third World theories had fallen from favor -- and being struck both by how Iranian the atmosphere was and somehow mired in the doctrinaire romanticism of the 60s on the Left Bank.

Returning with Khomeini just a year ago, Bani-Sadr showed another side of his character. He declined all official jobs and toured the country he no longer knew. He listened -- and talked to meetings in mosques -- while his rivals were stuck in Tehran.

It was that grass-roots organization -- and a driving ambition not immediately discernible beneath his almost timid manner -- which helped him to his landslide presidential victory last month in the face of less disciplined adversaries.

Such pragmatism, however, has not distracted him from pursuing his social and economic goals. It was Bani-Sadr who forced through the nationalization of banks and insurance companies last summer despite opposition from then-premier Mehdi Bazargan.

His refusal to accept dollars in payment for Iran's oil may yet prove to be a turning point in Organization of Petroleum Exporting Countries' policy.

He is determined to revamp the banking system to do away with interest, which, along with some other devout Moslems, he feels is counter to Islam.

But his broad vision is that of a classic revolutionary, determined to level class differences. In addition, he is a believer in "small is beautiful" and the moral advantages of a rural life compared to sinful city ways.

Ideologically, he is committed to improving agricultural production and preventing further rural exodus, if not forcing city dwellers back to the countryside.

Practically, he must somehow make the now-derelict industrial infrastructure, which the shah boasted would catapult Iran into the world's fifth power by the year 2000, perform at some level acceptable to the state that has become its owner.

These are the principal ingredients of the unhealthy legacy of the shah's overambition and his fall. They are also, with changes of degree and emphasis, common to many other developing countries, including those not blessed with Iran's oil riches.

The shah never succeeded in freeing Iran's economy from its dependence on oil. Indeed, that dependence grew despite industrialization.

It is still very much an open question whether Bani-sadr's leveling revolutionary economics will fare better now that Iran has stopped indulging in the shah's zealous acquisition of sophisticated U.S. weapons and nuclear power plants.

But it was just such hopes that helped Bani-sadr win more than 70 percent of the presidential vote even though the steadily falling turnout of voters for elections over the past year stood as a symbolic reminder that public faith in the revolution was waning.