Communist Party leaders in the Soviet and Afghan capitals have revived public calls for a political solution to the military conflict in Afghanistan, prompting speculation among some western diplomats here that the Kremlin is seeking to give fresh impetus to U.N.-sponsored talks designed to bring an end to the six-year-old war there.

But most western analysts view the most recent public statements about Afghanistan as a more explicit reiteration of longstanding policy, rather than a new policy position on the conflict in Afghanistan.

Kremlin leader Mikhail Gorbachev said today that the Soviet Union favors "a political settlement of the situation around Afghanistan" and is "wholly for" a "withdrawal of Soviet troops" from the country. Gorbachev made the remarks -- his first public statements on the Afghan war in eight months in office -- in a Kremlin speech to the Supreme Soviet.

In a speech to Communist Party members in Kabul last weekend, Afghan leader Babrak Karmal pledged to seek "cooperation even with some of those forces who adhere to a hostile position" toward his government, according to Tass, the official Soviet news agency. Karmal added, "We intend to settle inevitable disputes not with weapons, but in the way of a constructive dialogue," according to Tass.

Gorbachev said President Reagan had been informed of Moscow's support of a political solution during talks between the two last week in Geneva. But "if anybody hinders an early resolution of that question," Gorbachev said today, "it is above all the United States, which is financing, backing and arming gangs of counterrevolutionaries" -- a reference to antigovernment rebel forces fighting in Afghanistan.

Despite Gorbachev's accusations that the United States is impeding a solution to the Afghan war, his break with an apparent policy of closeting the war issue signaled to some western diplomats here that the Soviet leadership may be prepared to give new incentives to negotiators seeking a solution to the war. But they cautioned that Moscow may be proffering a higher public profile on the war to mask an intransigent stance on a military conflict that is increasingly unpopular abroad and at home, too.

Representatives of Afghanistan and Pakistan are due to start a new round of indirect talks on the Afghanistan war next month in Geneva. The negotiations started in 1982.

Western officials have complained that Moscow has stymied the talks by refusing to provide a timetable for the withdrawal of its estimated 118,000 troops fighting in Afghanistan.

Karmal's call for cooperation with "hostile" groups, made during a meeting of the Afghan Communist Party in Kabul, apparently was directed at some of the 3 million refugees who have fled Afghanistan since the 1979 Soviet invasion.