The shape of a compromise that could save the Panama Canal treaties emerged in the Senate yesterday, though there was no guarantee that Panama would accept it.

Sen. Dennis DeConcini (D-Ariz.), the key to resolving the present impasse, told reporters yesterday, "I'm optimistic and I'm not trying to sink any treaty."

DeConcini also said he could accept a new understanding added to the second canal treaty reiterating "our longstanding policy of nonintervention in foreign countries' internal affairs."

This is the compormise that Senate Democratic leaders were trying to reduce to legislative language yesterday.

A statement of this kind is now regarded as necessary to reassure Panamanian opinion, which has been incensed by a reservation DeConcine sponsored to the first canal treaty, adopted last month by 68 to 32 in the Senate.

That DeConcine reservation asserted an American right to take unilateral military action in Panama to keep the canal open if it is closed for any reason, including labor unrest in Panama or something of the kind.

Pabama has sent strong signals that it connot accept that reservation unless it is semehow mitigated by additional treaty language in which the United States reasserts that is has no intention of intervening in that country's internal affairs.

The issue now is essntially a semantic one, though its fate may depend on Panamaian emotions in the end - that is, on whether Panamanians will accept the massage of the original DeConcine reservation provided it is surrounded by other statements asserting American respect for the principle of nonintervation.

DeConcine and apparently some other senators as well are no prepared to make any change in the abasinc notion that the United States should retain the option to act unilaterally to keep the canal open.

DeConcine met yesterday with Senate leaders who are pressing the case for the treaties, including the majority leader, Sen.Robert C. Byrd (D-W.Va.) They proposed verbally some language for the sort of new understanding they have in mind.

DeConcini said that particular language was still unacceptable to him, but he said repeatedly that he thought acceptable language could be found.

The important thing to him, he said, was that the new understanding not appear to be a qualification to his own original reservation. It should only ne a general statement of respect for the principle of nonintervention, he said.

The Senate Democratic leadership told the administration that it should not stand aside, and let the Senate try to work this out by itself. DeConcini said yesterday that earlier plans for him to meet with President Carter have apparently been dropped.

"I'm not going to the White House, I guess," he said.

Several sources said that Byrd - who Wednesday appeared to some to be losing heart for the final effort to get the second treaty approved in a form that Panama could accept - yesterday seemed to be "back" on the team," as one source put it.

Byrd and other Senate leaders met yesterday with Vice President Mondale and Deputy Secretary of State Warren M. Christopher to discuss their latest efforts.

One idea the leaders are circulating is simply to restate language form the first treaty in a new understanding to the second stating that America will not intervene in Ranama's affairs, then fill the last days of debate with speeches emphasizing this point.

DeConcini said yesterday he, too> would be willing to make a speech on this theme.

Although the mood of treaty backers in the Senate was markedly better yesterday than the day before, there were not predictions of victory. Key administration officials and senators agreed that there was still time for more to go wrong before the Senate's final vote, scheduled for 6 p.m. next Tuesday.

There was an example of this yesterday. Sen. James Abourezk (D-S.D.), an outspoken opponent of deregulating the price of new natural gas, let it be known that he was so angry at the way the administration is handling the House-Senate conference on President Carter's energy plan that he might vote against the canal treaty in response.

At the very least, Abourezk suggested he would use the threat of a "no" vote to force the administration to do its negotiating with various factions on the energy issues in public.

Other sources revealed that Sen. James R. Sasser (D-Tenn.) is also angry with the administration, for reasons that could not be immeidately determined, and had cast a series of anti-administration votes on amendments to the second canal treaty to demostrate his pique.

Treaty supporter Sen. George McGovern (D-S.D.) denounced the DeConcini reservation as "a political and diplomatic disaster" and "a killer amendment" humiliating to Panama.

He said he retained only "a glimmer of hope" the issue could be resolved satisfactorily by some leadership-authored compromise and suggested that, if that does not come about, he might ask the Senate not to vote on the second treaty at all.

Sen. Daniel Patrick Moynihan (D. N. Y.) also decried the Senate's action in adopting the DeConcini reservation as did Sen. Floyd Haskell (D-Colo.), who told United press International he is "troubled" by the reservation.