Panamanian government circles appeared guardedly optimistic yesterday that the U.S. Senate would find a formula enabling Panama to make the canal treaties palatable at home. But the widespread popular opposition here to the treaty package continues to grow.

Officially, the government remains uncommitted to any course of action. But authoritative sources said that at least one sector of the government, including Gen. Omar Torrijos, now felt that Panama should make a strong effort to sell the treaties to a disenchanted public, provided the U.S. Senate comes up with a face saving formula.

Rather than be the party to reject the treaties, this sector feels, Panama ought to swallow some of its pride and once again emphasize the positive side of the treaties which turn over the waterway to Panama but permanently retain the U.S. right to defend the canal.

But how much pride Panama will want to swallow after a Senate reservation declaring that the U.S. could use unilateral military force - even against Panamanians - is now the big question mark.

There appears to be no consensus in the government yet on what Senate formula will do the trick although diplomatic and government analysts agree it must have legal authority and permit Torrijos to save face.

All politicial groups with the exception of the Communist Party have gone on record as rejection one or several American reservations and amendments which Panama did not vote for in last October's plebescite. These groups of left, right and center have been pressing the authoritarian regime for a share of the political pie in next August's elections.

They have used the American change in the canal treaties and the ensuing nationalist outrage as a vehicle against the government. Since Panama's national pride has been hurt by what Panamanians see as the "insulting" reservation on the use of force, these groups will find it very difficult to back away from their positions.

The barrage of letters, manifestos, discussion panels and many demonstrations against all our part of the treaties is still growing in the capital where one-third of Panama's 1.8 million population lives.Little is known about activities in the interior but knowledgeable Panamanians said that the opposition was picking up steam in the politized Chiriqui province.

Yesterday afternoon some two dozen students, representing leftist and Christian Democratic groups, demonstrated for an hour outside the U.S. Embassy. They painted "No military bases" on the palm trees in front of the building, shouting anti-American and anti-treaty slogans.

Although the embassy building, occupying one city block, was surrounded by armed Panamanian National Guardsmen, several students managed to jump over the hedge and tried to pull down the American flag. After they were carried out by the guardsmen, they burned a paper version of the stars and stripes. No violence was reported.

yesterda's student protest was small because the high schools and univerisities are still closed but student leaders said they were preparing large demonstrations for next week when classes will start again.

The press yesterday gave wide display to an unusual open letter to Torrijos written by 30 prominent Catholic priests saying they "emphatically rejected all the new amendments and reservations" of the American Senate and would support Torrijos if he did the same.