San Francisco, proud of its eccentric political and social traditions, has shocked even itself by calling a special election to determine if one of the most popular mayors in its history should be fired.

In a city full of unique political organizations and sects, one of the most bizarre--the self-described communist White Panther Party--has succeeded in collecting 35,000 signatures to recall Mayor Dianne Feinstein because her efforts to ban handguns interfered with their right to protect themselves against the police.

Bad feeling toward Feinstein in the city's large and politically potent homosexual community also appeared to have helped the petition drive succeed.

White Panther Party organizers circulated petitions in the heavily gay Castro district after Feinstein vetoed a city ordinance that would have given legal recognition to homosexual couples and other unmarried "domestic partners."

Deputy registrar of voters Yick Wong said today that his office had checked about 25 percent of the signatures and found that about 70 percent were valid. Feinstein has said she has no doubt that the required 19,357 valid signatures have been submitted and that she will have to defend herself in an April 26 recall election.

It will cost the city an estimated $400,000 to $500,000.

Tom Eastham, Feinstein's press secretary, said the mayor was confident that she would win the voting. The city treasury has a surplus, crime is down 5 percent and no opponent has appeared to challenge her for a second four-year term in the regular November election.

Feinstein has been repeating a remark by former mayor Elmer Robinson: "Dianne, you could get signatures in this city for hanging an overhead sewer over Market Street."

A San Francisco Examiner editorial called the petition drive "a perversion of the system of recall" designed to punish corruption, and some citizens have suggested toughening the recall requirements.

The city charter requires signatures from 10 percent of the total number voting in the last mayoral election for a special recall, while Washington, D.C., requires 10 percent of all registered voters, a much larger number, and bars recall elections in the first or last year of a mayor's term.

In Los Angeles, signatures from 15 percent of all registered voters are required for a recall election.

The White Panther Party, whose representatives could not be reached for comment, is reported to have about 30 members and to be led by Tom Stevens, who served a three-year prison term in the mid-1970s after a shoot-out with police at the group's Haight-Ashbury headquarters. The group's recall petitions, submitted Jan. 13 after a six-month campaign, accused Feinstein of a "tyrannical attack" on the constitutional right to bear arms.

In June, the city-county board of supervisors approved a Feinstein-sponsored ban on handguns, the first for a major U.S. city. But a state appeals court ruled the ban unconstitutional because it usurped powers given only to the state legislature. The city has appealed to the state supreme court.

The city's interest in banning handguns stems in part from the 1978 assassination of Supervisor Harvey Milk and Mayor George Moscone, whom Feinstein succeeded.

Eastham noted that the special election may help Feinstein by giving her campaign for reelection an early start and making it difficult for anyone to oppose her without seeming to be in alliance with the White Panthers.