For nearly five weeks President Carter has managed the Iran crisis without any serious challenge to his leadership from Congress, a noticeable departure from recent congressional behavior on foreign policy matters.

Interviews with numerous numbers of the House and Senate this week suggested that the events in Tehran have created an unusually strong national consenus, reflected in Congress, which has helped Carter politically and given him a freedom to maneuver that is unprecedented for a president in recent years.

However, the interviews indicated that future events could shatter the consensus quickly. Many on the Hill, especially Republicans, argue that the political benefits Iran has brought to Carter will be short-lived, though others see more lasting improvements in the president's position.

"This is the only thing that has unified the country since before Vietnam," one senior Democratic senator said. His view was widely echoed.

"It could have gotten out of hand, with everyone going off in separate directions," observed Rep. Elliott H. Levitas (D-Ga.), commenting on the "very restrained" reactions of his coleagues.

Rep. Thomas J. Downey (D-N.Y.), a liberal, said members of Congress were reflecting a restrained public reaction to the crisis, which he said he had seen even at a meeting of the Veterans of Foreign Wars, where he thought attitudes might have been more bellicose.

"We find out which way the wind is blowing and jump out in front of it," Downey said of members of Congress. "The wind in this case is responsible. That's why we're being responsible."

Another reason for the congressional restraint, several members observed, was the sharp public rebukes that greeted the only two members who departed dramatically from the norm, Rep. George V. Hansen (R-Idaho) and Sen. Edward M. Kennedy (D-Mass.). So far, at least, most members have seen nothing to be gained by publicly separating themselves from the president.

The only organized challenge to Carter's policy has been mild. Indeed, its organizer, Rep. Samuel S. Stratton (D-N.Y.), denies that it was meant to be "critical of the president" at all. That was a resolution introduced by Stratton and cosponsored by 50 or so House colleagues asking the president to set a deadline for the release of American hostages from Iran, accompanying it with specific threats of countermeasures if the deadline were not met.

In an interview, Stratton said calls and letters to his office had been predominantly critical of his idea. He blamed this on a perception that he was trying to challenge Carter's handling of the crisis, which he denies.

After nearly five weeks, congressional forbearance to Iran has had tangible consequences beyond the freedom of action it has given the president. For example, administration lobbyists believe the House-Senate conference on Carter's latest energy proposals moved more quickly because of the Iran crisis.

Carter told congressional leaders that speedy action on the energy proposals would send a helpful message to the Iranians and other oil-producing nations, one White House official said, and the leaders responded favorably.

Even Carter's critics acknowledge that he has also been given a significant political boost, because of his performance during the crisis and because his principle Democratic rival Kennedy, appears to have stubbed a political toe with his attack on the deposed shah of Iran.

Sen. Ted Stevens (R-Alaska), the minority whip in the Senate, disputed the idea that Carter will enjoy any lasting benefit from this crisis. "It'll be over one of these days," Stevens said, "and then other items will take the forefront. People are supporting the presidency now, not just this president."

Stevens has been one of the recipients of unusually intense administration briefings for congressional leaders that began in the third week of the crisis after a complaint from Majority Leader Robert C. Byrd (D-W.Va.) that Congress was being insufficently consulted.

Now Secretary of State Cyrus R. Vance or his deputy, Warren Christopher, see House and Senate leaders daily, and offer briefings to the House and Senate every few days.

Stevens praised the consultations and said that they had helped him and other leaders dissuade senators who might have spoken out on their own from doing so.

Many of the members of Congress interviewed said one aspect of the crisis was especially helpful for the president -- the "irrationality" of the Ayatollah Ruhollah Khomeini, as one senator put it.

"There's not a damn thing you can do when you're dealing with a crazy man," another senator observed.

Rep. Downey praised the news media for drawing "an accurate picture" of the risks involved in any U.S. military action as long as American hostages are held in Tehran.

Looking ahead, may members of Congress predicted that the national restraint shown so far won't last indefinitely. "It's already crumbling around the edges," said Rep. Jack Edwards (R-Ala.). "We have to be careful not to be led into wrong moves out of frustration," he added.