The Soviet invasion of Afghanistan and the wavering policies of the French government toward it have stirred deep historical memories of how the French nation divided before, during and after World War II over whether to collaborate with Nazi Germany or to resist it.

"The new split in French society between the partisans of firmness and those of detente at any price could eclipse the traditional divisions between the right and the left" -- just as in the 1930's and 1940's one of the leading confidential newsletters in Paris wrote.

Many analysts wonder whether President Valery Giscard d'Estaing is trying to go even beyond a policy of appeasement to take the leadership of the nonaligned movement, while somehow managing to stay inside the Atlantic Alliance.

With Yugoslav President Tito dying and the other major leaders of the nonaligned movement long dead, Giscard's friends see a role waiting to be filled.

As former interior minister Michel Poniatowski, once and perhaps still Giscard's closest adviser, recently put it; "If there is really a risk of nuclear war between the superpowers, should our first preoccupation not be to escape it and not to take part in the super suicide of the super great powers? That means we must have a strictly European nuclear dissuasion force. . . . The victors will be the survivors."

This was followed up by the joint Franco-West German declaration recalling both countries' membership in the Atlantic Alliance but also making a deep bow toward the "authentically nonaligned" nations -- an obvious attempt to stress that the claim of countries such as Cuba to nonaligned leadership does not go undisputed.

Such signals are not lost on governments like Romania, the France of the Warsaw Pact alliance. Romanian President Nicolai Ceaucescu cabled Giscard yesterday that he would like "to work together to end the current aggravation of the international situation."

Referring to the legacy of Giscard's predecessor, Charles de Gaulle, who led France out of NATO but kept it inside the Atlantic Alliance, a West German observer remarked, "Gaullist thinking is not limited to the Gaullist Party. It is now part of the national heritage."

Not everyone sees it so clearly, however, and the struggle for De Gaulle's mantle is a continuing feature of French politics.

Asked what De Gaulle would have done in the current crisis, Maurice Couve de Murville, his foreign minister of many years, said he did not know, but: "A country that is a member of an alliance cannot say that it is nonaligned. It is a contradiction in terms. France should follow its own policy. It should not offer its good offices between the great powers.That is both derisory and disagreeable."

Yet, a few days later, Gaullist Party leader Jacques Chirac was making it clear that he has chosen not to dissent from Giscard's approach.

Giscard is no Gaullist. He came to power with the image of a friend of the United States rather than Gaullist-style adversary. But those who reflect his private thinking now use traditional Gaullist vocabulary to question the reliability of the United States generally and President Carter in particular.

De Gaulle was constantly shifting his weight from one side to the other in the international power equation. Yet, as the leader of the wartime resistance forces no one ever expected to find him on the side of the neutralists or the appeasers. In the 1961 Berlin Wall crisis and in the 1962 Cuban missile crisis he urged the United States to stand up to the Soviets.

The Gaullist faithful tend to see Giscard as the leader of those who in the past favored appeasement and collaboration. A poll published by the magazine Nouvelles Litteraires indicated that 53 percent of Giscardist voters in 1974 held a positive view of De Gaulle's arch rival, Marshal Petain, the leader of the collaborationist Vichy puppet state in World War II.

This goes far to explain why the Giscardist-Gaullist political alliance so often seems to be on the verge of breakup.

Using Gaullist rhetoric, Giscard's defenders argue that it is thanks to France's refusal to line up automatically behind the United States that countries such as India have urged Soviet withdrawal from Afghanistan and that countries such as Poland and East Germany have been willing to throw out hints that they do not go along wholeheartedly.

French officials say it behooves the West to do nothing that will polarize the Third World into two hostile camps -- forcing radical, and oil-producing, states such as Iraq and Algeria irretrievably into the arms of the Soviets while creating on the other side latter-day equivalents of the ineffective alliance systems that disappeared with the dissolution of CENTO and SEATO.

The French officials say their own 15-year experience in detente dialogue with the Soviets gives them a special understanding that Washington should consider.

Giscard reportedly has said he recognizes that French policy is too complicated ever to be really understood by American public opinion. "To the average American, it undoubtedly looks contradictory to say we are your allies and we have our own independent foreign policy," a member of Giscard's staff said.

Despite all the French stress on the Third World, French officials show that they understand where real power lies. That is why Giscard has gone to such pains to keep in step with West Germany.

Keeping Paris and Bonn together in the crisis was a major accomplishment, said an official with access to Giscard's thinking. "Together, they are the world's third power -- economically, militarily, politically and psychologically."

If only because Giscard does not want to get too far away from West German Chancellor Helmut Schmidt, France can be counted on not to kick over the alliance traces altogether. At most, France will continue to be the Romania of the West.

Romania's insistence on independent policy judgments clearly has made the Soviets uneasy, however, over whether the Romanians can be counted on.

"Why die for Danzig?" was the question raised in the French press by opponents of standing up to the Nazi takeover of Poland's outlet to the sea. That question was a bitterly ironic sound in French ears today, and the opponents of Giscard's temporizing are now taunting him with the question, "why die for Kabul?"

In 1939, France took six agonizing extra hours to declare war on Germany after Britain had done so. The six hours came to symbolize a difference in approach that led to the French surrender and the creation of Vichy.

Now, it has taken France six weeks to get together with Germany on a strong-sounding condemnation of the Soviets in Kabul. Even so, it was not with ambiguities and reservations.