Optimism accompanied a new round of talks held today between caretaker Prime Minister Bettino Craxi and Italian political leaders to form a government to replace the one that collapsed 12 days ago in the aftermath of the Achille Lauro hijacking.

After Craxi met separately with the leaders of the five parties that made up the coalition he led for 26 months, he called a joint meeting for Tuesday afternoon. Sources close to the Socialist prime minister expressed cautious optimism that an accord will ultimately reconstitute the former coalition.

Social Democratic leader Franco Nicolazzi told reporters he thinks conditions are favorable for a reconciliation among the coalition parties, the Christian Democrats, Socialists, Republicans, Social Democrats and Liberals. The leader of the Liberal Party, Alfredo Biondi, pointed to the joint meeting as the most promising sign that a resolution is near.

The sources said, however, that the success of the negotiations still depends on the attitude of outgoing Defense Minister Giovanni Spadolini, the Republican Party leader who played a major role in bringing down the government during the Achille Lauro crisis.

After meeting with Craxi today for 1 1/2 hours, Spadolini was noncommittal about the prospects of a new five-party coalition being formed. But he said he and Craxi had gone into a "wide, deep and analytic exam" of Republican demands on which reconstitution depends. Later, the Republicans authorized Spadolini to participate in Tuesday's negotiations.

Craxi's consultations took place as a judge in Syracuse, Sicily, conducted an investigation into a tense armed confrontation that occurred Oct. 11 between Italian and U.S. military personnel at the Sigonella NATO base after U.S. jets intercepted an official Egyptian plane carrying the Achille Lauro hijackers.

Although Italian paramilitary carabinieri police -- later reinforced by military policemen -- immediately surrounded the Egyptian plane, U.S. commandos disembarked from C141 transport planes and surrounded the Italian guards, setting up a three-hour conflict, until President Reagan, in his second telephone conversation of the night with Craxi, agreed to allow Italy to try the hijackers.

Judicial sources said an initial report by the carabinieri denied that shots had been fired during the incident. The reports also said the carabinieri had maintained that the U.S. troops, apparently under the command of Maj. Gen. Carl W. Stiner, had not violated Italian laws.

The court, however, planned to continue interviewing witnesses involved in the affair. Some sources said the court might even try to open a review of Stiner's apparent attempt to pursue the Egyptian plane in a T39 trainer to Rome's Ciampino Airport.

Craxi already has claimed that the United States violated Italian airspace by following the Egyptian plane to Rome without requesting the proper authorization.

Italian government officials said today that a 1955 base accord allows U.S. military personnel on NATO bases to be tried by U.S. authorities rather than Italian courts for infractions committed on base grounds. This rule probably will prevent a full-scale trial by an Italian court. The Italian magistrates' investigation nevertheless kept the sensitive Sigonella confrontation alive today in Italy.

Craxi's convening a joint meeting of all five party leaders in his former coalition for Tuesday is generally taken as a sign that the normally painful process of government formation has moved to the stage of collective bargaining over policies, decision-making protocol and, possibly, Cabinet makeup.

Spadolini previously had insisted that he would not rejoin the government coalition unless there were a new accord on the sharing of government decision-making among coalition partners, a revision of the government's pro-Arab foreign policy and a reinforcement of Italy's commitment to the United States.

Craxi has said that he is open to discussing coalition decision-making. While he maintained that Italy's foreign policy is beyond negotiation, he reaffirmed the nation's commitment to the Atlantic Alliance by joining other leaders of industrialized countries meeting with President Reagan in New York last week.

Italian political analysts said that Spadolini could be expected to soften his demands somewhat because his stand against Craxi's handling of the Achille Lauro affair has tended to isolate him politically. The other coalition members, along with the general public, have by and large supported Craxi throughout the hijacking crisis, during which U.S. actions were seen as a challenge to Italian sovereignty.