Two Soviet cargo ships laden with military supplies for Iraq have steamed out of the Persian Gulf war zone without unloading, government officials said yesterday.

Warships from the United States, Australia, Britain and France, meanwhile, were positioning themselves where they could participate in a multinational show of strength and, if such a step became necessary, force open the Strait of Hormuz, a chokepoint in the Persian Gulf leading to oil terminals.

The departure from the gulf of the Soviet ships Kommuna and Lebedyev buttressed Carter administration hopes that Moscow will continue refusing to resupply Baghdad. Such restraint could help bring the war to an end.

A less optimistic U.S. government interpretation is that Soviet commanders decided to recall their cargo ships rather than risk having them sunk, and that they may resupply Iraq later.

But so far so good, U.S. officials agreed in relaying the thrust of intelligence reports stating that the Soviet Union has not resupplied Iraq in any significant way since the Iraq-Iran war began.

One Soviet ship full of military hardware was in the Iraq port of Basra as the war started, officials said, and presumably was unloaded. It is still in port.

As the Soviet ships were leaving the gulf in what may symbolize the Kremlin's desire to contain and control the war, ships from western nations were taking positions in the Indian Ocean area, possibly for a multinational demonstration of naval strength underscoring their determination to keep the vital Strait of Hormuz open to oil tankers.

U.S. officials said yesterday that New Zealand has agreed to discuss the possibility of a naval task force. Reuter reported that New Zealand Prime Minister Robert Muldoon said Washington also had consulted the gulf states, Australia, France, Britain and Italy.

The Australian task force steaming toward the Indian Ocean consists of the aircraft carrier Melbourne and at least three destroyer escorts. Although these warships were scheduled to go to the Indian Ocean before the war broke out, Australian officials indicated that they could see duty if a Hormuz demonstration is staged.

Australian Prime Minister J. Malcom Fraser said yesterday in Melbourne that his government was in the "closest possible discussions" about participating in a Strait of Hormuz multinational naval force.

The British destroyer Conventry, accompanied by an oiler for refueling, is also steaming toward the Indian Ocean, where it could participate in a Hormuz task force. British officials have declined to describe her mission, but U.S. officials linked her deployment to a possible show of force.

France has 15 ships plying Middle Eastern and East African waters, about five of them in the Indian Ocean, officials said yesterday. So French ships are in position to join any Hormuz effort as well.

The United States, meanwhile, has decided to keep two aircraft carriers in the Arabian Sea rather than let the Eisenhower sail to Australia for leave, as planned, after the aircraft carrier Midway arrives from Mombasa to take her place.

Navy leaders consider carrier planes essential to stop any attempt by Iran to send warplanes against merchant ships sailing through the Strait of Hormuz. The Iranian air threat to tankers is more worrisome to U.S. officials than is the threat of Iran's mining the strait.

Undersecretary of the Navy Robert J. Murray said yesterday that Iran would have great difficulty in mining the strait, which is 30 miles wide at its narrowest point -- about the distance between Washington and Baltimore. He said the United States and other countries could sweep those mines without much risk of the Iranian navy stopping them.

But quick strikes from the air by Iranian jets might well impel tanker firms to stop using the strait, Murray added. Iranian bases put Iranian F4 fighter-bombers in easy reach of the strait.

Navy planes from the Eisenhower and Midway also offer the best chance of downing Iranian planes if Tehran should decide to bomb neighbors other than Iraq. Saudi Arabia is a possible target of such bombing, prompting the Carter administration to send four AWACS warning planes to Saudi Arabia.

An AWACS (Airbourne Warning and Control System) plane can spot an invading plane from hundreds of miles away and direct fighters toward it. Iran and its neighbors have big gaps in their ground and aircraft defenses, which is one reason Iran and Iraq are bombing each other with relative ease.