Indian Prime Minister Rajiv Gandhi called yesterday for an international political settlement that would result in a "nonaligned" Afghanistan, amid indications that he is considering a more active political role on the issue.

"We stand for a political settlement in Afghanistan that ensures sovereignty, integrity, independence and nonaligned status and enables the refugees to return to their homes in safety and honor," Gandhi told a joint session of Congress, where he received frequent and warm applause.

His remarks on Afghanistan were described as "encouraging" by Reagan administration officials, who have asked India since early this year to become more active in pursuing a political settlement.

The officials were anything but pleased, though, by Gandhi's critical remarks about President Reagan's Strategic Defense Initiative (SDI), which the administration plans to discuss in detail today with the Indian leader.

Several hours after addressing Congress, Gandhi told reporters that "we're not ready yet" to decide whether or how to broaden India's efforts regarding Afghanistan. "We've had some talks with the Soviet Union," he said, referring to his visit to Moscow last month, "and some talks with the United States, which we have really not evaluated."

Indian sources said hints from Soviet leader Mikhail Gorbachev and other Soviet officials during Gandhi's visit raised the question of whether Moscow is prepared to consider a new tack in Afghanistan. More than 100,000 Soviet troops have been fighting with limited success for more than five years to subdue Afghan guerrillas supported by the United States and several Islamic countries.

Gandhi, in his address to Congress, appeared to equate the Soviet troops with the Afghan rebels, saying, "We are opposed to both foreign presences and pressures. The one is advanced as a justification for the other."

The United States hopes to probe the Soviet position next week when State Department and Soviet Foreign Ministry officials are expected to discuss Afghanistan for the first time in nearly three years. Later next week, U.N.-sponsored "indirect" talks involving the Afghan and Pakistani governments are to resume in Geneva. Gandhi said yesterday that India "fully supports" the U.N. effort.

Gandhi has expressed skepticism for several months about Reagan's SDI, or "Star Wars," plan. In an apparent reference to the U.S. effort, he told Congress, "We are concerned about any new dimensions to the arms race . . . . Hence our deep reservation about the militarization of outer space." This remark drew applause, especially from Democrats.

During a meeting several hours later with astronomer Carl Sagan, Gandhi said Reagan's space-based antimissile plan "doesn't really help" to move the world toward disarmament and "only brings things closer to the brink." Gandhi said he fears that "it's bound to become an offensive weapon" despite a billing as purely defensive.

In a White House meeting Wednesday, Reagan and other ranking U.S. officials sought to persuade Gandhi of the SDI's value and offered additional briefings. Lt. Gen. James A. Abrahamson, director of the SDI organization, and State Department arms adviser Paul H. Nitze are to brief Gandhi today, officials said.

Sagan and Gandhi discussed SDI when the Cornell astronomer presented a statement signed by 84 Nobel Prize winners and other scientists supporting a call by Gandhi and five other national leaders for a halt in testing, deployment and production of nuclear weapons.

The disarmament initiative was originally signed in May 1984 by Gandhi's late mother, Indira. Rajiv Gandhi brought it up with Gorbachev in the Kremlin last month and with Reagan at the White House Wednesday.

The Indian prime minister said that Gorbachev had been "very positive" and that the Soviets "are willing to disarm." Reagan, he reported, agreed that "he is also for disarmament" but wants to achieve this "via SDI," of which Gandhi is highly skeptical.

Gandhi, 40, expressed caution about possible purchases of U.S. sophisticated military technology and weaponry, following reports that the Reagan administration is prepared to make such sales if strict guidelines are set on use and shipment.

Gandhi told reporters that India has had two problems with purchase of U.S. weapons: "The terms of supply can be altered retroactively by the United States, and we have doubts about the reliability of the United States as a supplier of spare parts and other equipment." He said it would "take time" to establish confidence in Washington as an arms supplier.