The Panamanian government, latest host to the exiled shah of Iran, appears anxious to obscure its policy toward the deposed monarch and has thrown up a smokescreen of ambiguous legal language, confusing statements about his status quo and reports of high-level phone calls and secret missions between Panama and Iran.

Having granted the shah political asylum here five weeks ago, the government now refuses to state categorically whether or not it will accept Iran's demand that the shah be extradited to face trial in Iran.

Instead, it insists on following a legal process which will eventually be subject to a political decision by the executive. That decision, in the view of many Panamanians inside and outside the government, will be that Panama does not plan to extradite the shah.

In the meantime, diplomats believe that Panama's move serves to avoid further friction with Iran. It buys time and offers a potential face-saving device that might help to enable Iran's incoming government to release the estimated 50 hostages held at the U.S. Embassy.

Opposition lawyers who have been poring over the diplomatic exchanges between Panama City and Tehran say they must be the result of American counseling. U.S. officials here deny any special knowledge or involvement.

Panama apparently has become entangled in the controversy over the shah because of its need for U.S. support for the recovery of its depressed economy and for the implementation of the Panama Canal treaties, on which Panama says the United States is dragging its feet.

Although Panama's strongman, Brig. Gen. Omar Torrijos, has an image among U.S. senators opposed to the treaties of being an anti-American leftist, Panama has rallied to the U.S. side.

Early last year, when the shah was in need of a haven, Torrijos reportedly sent word that he would be welcome here. In February, the shah's son came here on a reconnaissance trip but instead the Pahlavis chose Mexico at that time. Sources here said the invitation remained open.

Torrijos has become an admirer of President Carter for his staunch fight for the canal treaties. Panama was the first country at the United Nations to protest the Iranian seizure of the U.S. Embassy in November.

Nevertheless, since the shah's arrival here Dec. 15, a diplomatic channel has opened between Panama City and Tehran. The to-and-fro has prompted scathing remarks from U.S. and U.N. officials, saying that Panama presumed it could carve out a simple solution of its own to free the hostages.

Panamanian President Aristides Royo has acknowledged speaking twice by telephone to Iranian Foreign Minister Sadegh Ghotbzadeh, who announced last week that Royo had said the shah was under arrest. Persons close to Royo said Ghotbzadeh "exaggerated and was clearly whipping it up for his election campaign."

A Panamanian spokesman has repeatedly denied that the shah was under arrest.

Iran made use of a Panamanian law that says a "diplomatic warning" of an impending extradition request requires arrest of the person concerned.

Royo than cabled Tehran that the shah "remains under the care of the security authorities" and that Panama had "adopted precautionary measures pertinent to his stay."

A person familiar with the proceedings said, "ambiguity has an important function in diplomacy."

The Iranian government also invited to Tehran a group of Panamanian students who had demanded the shah's expulsion following his arrival here. Four students belonging to the traditionally pro-government Panamanian Students' Federation accompanied by a television reporter, were in Iran Jan. 5-12.

According to Mario Parnther, the secretary general of the federation who went on the trip, they met high officials of Iran's Revolutionary Council and were asked to change their demands from the shah's expulsion from Panama to his extradition to Iran. The Panamanians said they agreed to this and will pressure the government when the extradition request arrives.

The students visited the occupied U.S. Embassy, although they did not see the hostages.

Parnther said they were especially struck by Tehran, "which we found even more Americanized than Panama. We are very conscious of their struggle against the Americans. We have had to coexist with Americans for so long that we are very sensitive to this."

He said the Iranians also felt falsely represented in the American press. "We understand this," said Parnther, "because we have been very insulted and distorted by Americans during the canal debate."

Some government officials here fear that what appears to be political theater may backfire at Panama.

On the one hand, lawyers here argue, Panama has a way out, because its law forbids extradition of a foreigner for political reasons or if the person will face a death penalty at home.

But on the other hand, the government is aware that Panama, with its many embassies abroad, its canal and numerous ships carrying the Panamanian flag of convenience, is vulnerable to an angry Iran. Moreover, Panamanian students have been promised in Iran they will get copies of the documents detailing the shah's alleged crimes, which will be sent to the Panamanian government.

Many of the students are infuriated over the government's violent repression of anti-shah demonstrations here last month. Many people were beaten by the National Guard and wounded by its buckshot. These students say they will use the Iranian documents of an anti-imperialist campaign.

One sign that the Panamanian government is already getting flustered over its legal tightrope-walking came yesterday, as President Royo ordered reporter Sally Chardy of NBC Radio expelled for allegedly misquoting him regarding the shah's extradition. Such a measure is highly unusual in Panama.

Yet for all the controversy over the shah here in the capital, the quiet life is said to be the rule of the Pahlavi family on Contadora Island, in the Pacific, 20 minutes away by plane.

The Panamanian government prevents journalists from going to Contadora so as not to bother the shah, and has put Air Force craft at his disposal.

The exiled monarch has flown several times to meet the Panamanian president in the countryside and has met at least one with Torrijos.

Recently, the shah and his wife flew to Chiriqui, Panama's most conservative province, where they were enthusiastically received.

"Hundreds of schoolchildren waved flags at him and people went up to touch him," said a person there for the event. "He got a hero's welcome and clearly loved it. I guess it's been a long time since that happened to him.