France is seriously considering a call for demilitarization of the Indian Ocean and Persian Gulf that would exclude the United States and the Soviet Union from the region, according to French and other sources.

President Valery Giscard d'Estaing is studying the idea of an international conference on the subject, the sources said.

The French idea comes as the Carter administration is implementing plans to build up the U.S. presence in the area. The buildup would ensure that the United States would not again be caught without conventional forces in the volatile region that recently has seen Iran's Islamic revolution and the Soviet invasion of Afghanistan.

U.S. Defense Secretary Harold Brown spent nearly two hours with Giscard on Tuesday to brief him on U.S. plans to beef up rapid deployment forces and to acquire Indian Ocean facilities in Kenya, Oman and possibly Somalia, U.S. sources indicated.

The only existing U.S. base in the area is on the island of Diego Garcia, which Washington acquired from Britain after the British transferred its population to the distant island of Mauritius. A summit meeting of the Organization of African Unity wound up yesterday with a surprise demand that Diego Garcia be returned to the newly independent Mauritius. Its prime minister reportedly will make the request in London talks Monday.

Little is being said about Brown's talks with Giscard. American journalists were invited to be present as Brown emerged from the French presidential palace, when the secretary was to answer questions. Before he came out, however, an Elysee spokesman said Brown would have nothing do say. The Elysee itself issued a "no comment" on the meeting.

The next day, presidential briefers started stressing a series on half-forgotten communiques that Giscard signed four months ago on a trip to the Persian Gulf emirates, calling for the two superpowers to stay out of the area. The briefers insisted that their message had nothing to do with the Brown-Giscard talks.

"There are certain regions of the world," said an Elysee briefer, "where we don't think the reinforcement of security is helped by Western military presence. We don't think the American presence is an element of stabilization. There are many conflicts in that region, many rivalries. The appearance of one of the superpower in a state of the region could provoke a call to the other superpower to aid a neighboring state."

American offers of military aid to China and Pakistan after the invasion of Afghanistan were a mistaken approach to a problem that needs a political, no a military solution, the briefer said.

France particularly opposes the replacement of the Soviet military presence with an American one in the case of Somalia, he indicated. States of the region that grant facilities to outside powers have found it to be a source of internal destabilization, he said.

He stressed that the continued French military presence in its former Red Sea colony of Djibouti is an exception since the young republic asked France to remain there to protect it from the rival claims of neighboring Ethiopia and Somalia. France has 4,000 troops there as well as major naval facilities that are the main base for France's large fleet in the Indian Ocean -- by far the strongest in the region before the U.S. naval buildup in response to the crises in Iran and Afghanistan.

If the Indian Ocean were to be neutralized or demilitarized, as various Third World countries have proposed in the past, France could argue that the banning of fleets foreign to the region does not apply to the French fleet since it still has important possessions there. These include the heavily populated island of Reunion, which votes as part of France, and the island of Mayotte in the Comoros, which refused to join the rest of the islands in the group when they became independent.

French officials argue that French presence is traditional and has general acceptance, whereas the U.S. and Soviet presence are new, disturbing elements.

In private conversations, French officials say the United States probably could count on using French facilities in Djibouti in a major crisis, depending on its nature, but the United States should not compromise the "miracle" of continued French presence there by publicly or formally seeking anything in advance.

Informed sources say Franco-American naval cooperation at the working level in the Indian Ocean is excellent.

A U.S. source privy to Brown's conversation said Giscard did not express any opposition to U.S. efforts to get new facilities in the region. This was because the French leader believes that a U.S. evacuation should be accompanied by a Soviet departure that does not seem imminent. But in light of the Third World calls for the United States to give up Diego Garcia, any French call for regional demilitarization seems bound to be seen by the African and South Asian countries of the Indian Ocean as an endorsement of the kind of Third World anti-Americanism that they express.

The communiques that Giscard signed in the Persian Gulf placed the United States and the Soviet Union on the same level, in the way that the late Charles de Gaulle often did. But it was striking that Giscard did this so soon after the Soviet invasion of Afghanistan.

Giscard was reported this week by the usually well-informed weekly Canard Enchaine to be planning an Indian Ocean trip that would include Somalia, Djibouti and Madagascar.Elysee sources said that nothing has been decided.

The French president has a history of using such distant countries as the platform for dramatic diplomatic statements, usually designed to refurbish France's image as the Third World's best friend in the West.