How can Socialist President Francois Mitterrand be serious in insistently claiming to be America's most steadfast ally, and at the same time include Communists in government for the first time in 34 years?

The answer to that seeming conundrum -- worrying in American eyes -- but considered more apparent than real in France -- lies in the intricacies of domestic French politics.

Ever since the late Gen. Charles de Gaulle founded the Fifth Republic in 1958, its internal dynamics turned on Communist support for the right and center at election time. The tactic was simple: governments projected the image of close relations with Moscow and arms-length diffidence toward Washington.

Communist votes were siphoned off and labor peace was assured, except for largely set-piece demonstrations, thanks to the remote-controlled docility of the largest and Communist-dominated trade union.

The usefulness of that formula came to an end when Mitterrand beat Valery Giscard d'Estaing for the presidency in May.

Mitterrand felt no need to imitate his predecessor's studied ambiguity toward the Kremlin or French Communists. He had fashioned a new Socialist Party from the ashes by working with the Communists, only to suffer from their perfidy once the Socialists began outdistancing the Communists at the polls.

Indeed, as so many other European socialists had discovered before him, Mitterrand realized that the Communists hate their erstwhile allies -- often denounced as "social traitors" -- as much, if not more, than their rightist and centrist political foes.

Yet, the Socialists' absolute majority in the National Assembly was made possible in part by Communist votes. Communist deserters backed Socialist candidates rather than their own in the first round.

Rank-and-file Communist stalwarts followed the party line by backing front-leading Socialists against rightist candidates in the runoffs.

Mitterrand appointed four Communists to relatively minor government jobs to acknowledge that electoral debt and also to dissuade the communist leadership and its trade union colleagues from undermining his government from the outside. Although distinguished comentators such as Raymond Aron remain skeptical about the fine print, the Socialists virtually obtained the Communists' surrender on Afghanistan, Poland and East-West matters as the price for those four ministers.

From Mitterrand on down, the Socialists in government have been talking a very tough game with the Soviets on everything from Poland to the presence of Moscow's troops in Afghanistan. They have been outspoken in their warnings against the danger of European neutralism and passivity.

In language scarcely distinguishable from the Reagan's administration's, for instance, Mitterrand had such worries in mind when he recently came out for deployment of U.S. nuclear missiles to offset the Soviets' Backfire bombers and SS20 missiles.

Installation of these Soviet weapons, he told the West German magazine Stern, "has upset the military equilibrium in Europe. I will not accept this and I agree that we must arm to restore the balance. At that point we should start negotiating."

By saying that Europe should install new weapons without awaiting the outcome of arms control talks, Mitterrand was bucking up skittish leaders in Belgium, Britain, Italy, the Netherlands and West Germany, where 572 American medium-range missiles are to be installed.

"It is a tough game in which there can be no weakness," Mitterrand said, "in which you must know when to arm and when to negotiate."