The idea is gaining currency that somehow the United Nations should handle the crisis in the Gulf. In part the idea reflects frustration and escapism -- the thought of handing off a sticky problem under a label of highmindedness. But it also arises from the circumstance, one brought into sharp relief by the parallel Soviet and American naval initiatives, that for once the great powers are working the same side of the street.

At the Venice summit, the seven leaders not only ''strongly supported'' the secretary general's mediation efforts but also urged ''just and effective measures'' by the Security Council. Moscow favors an international approach, ''above all within the U. N. framework.''

In fact, Secretary General Javier Perez de Cuellar has had some success promoting steps to reduce an otherwise terrible toll of civilian losses in the war. His desperate mediation efforts, however, have failed. It is necessary to ask why.

The conventional answer is that revolutionary Iran is intransigent in pressing its invasion of Iraq, in refusing to negotiate and in demanding strongman Saddam Hussein's head. It is ostensibly to appply pressure on Tehran and induce it to come to the table that the United States has offered to care for Kuwaiti tankers and that it has been seeking at the Security Council to organize an arms embargo on Iran.

But there is a more illuminating explanation of why mediation and negotiation have so far failed. It comes down to the little-acknowledged fact that the United Nations -- meaning here the Security Council -- has a very suspect and one-sided record in dealing with the war from the start.

When Iraq invaded Iran in 1980, the Security Council dithered: the five permanent members, including Moscow and Washington, evidently hoped Iraq would quickly prevail over the troublesome Islamic regime. When the council finally did get around to calling for a cease-fire, it said nothing about demanding withdrawal from territory occupied in war.

Iran has boycotted the Security Council's Gulf proceedings since, ignoring the repeated appeals for its moderation and restraint that the council started making once Iran took the offensive and crossed into Iraq.

It takes a leap of faith, not to speak of a suspension of distaste, to imagine that anything is soon going to get through to Iran's determined -- to the Reagan administration, ''lunatic'' -- leaders. Still, the idea is stirring that the Security Council must not only put pressure on Iran but do something to earn a hearing with an Iranian regime that has abiding memories of the council's past unfairness. But what can be done that not only engages Tehran but fits the security and political interests of Iraq and its fellow Arabs, and others?

Perez de Cuellar, who has kept up contacts with both sides even while the Security Council swung way over to Iraq, quietly presented to the five permanent council members last January the idea of setting up an impartial committee of respected people to inquire into the question of responsibility for initiating hostilities in the Iran-Iraq war.

The Iranians, according to an informed report, were very much for this proposal, which offered them for the first time a potential for the justice they crave -- as they see justice. Nor did the Iraqis object when the secretary general presented the proposal to them. The USS Stark incident interrupted deliberations by the council five on a package including negotiations, sanctions and an impartial committee, but the proposal remains alive, and Americans hope it may be ready for public presentation in a few weeks.

The risk of the committee idea is that it could stoke the Tehran regime's appetite for vengeance. Its promise is that it could demonstrate the good faith of the Security Council to Iran and allow the council, which, as everyone notes, is equipped by great-power consensus to act on this issue, to work for a cease-fire, withdrawal and political settlement. Presumably this effort could proceed on the basis of an unpublished eight-point plan developed by the secretary general.

Iran is a tough country to be fair to. It is a long shot, moreover, that its policy will be affected by anything other than a change of leadership or the pressure of events. But it is a long and terrible war. The committee idea could be a key to helping end it.