BEFORE THE SHOUTING starts up again, let's fix a cool, appraising, Bakeresque eye on the shah: What did he do and when did he do it?

Specifically, the shah has been accused of having had under lock and key either 350,000 or 100,000 foes of his regime (according to Khomeini and exile sources as far back as the mid-1970s) and of having killed 100,000 enemies (Khomeini).

The issue has now been joined, and it is at least conceivable that the U.N commission recently in Tehran will be less than a model of dispassionate analysis. The temptation will be to measure truth with a decibel meter. In this lull, what does the record show, insofar as anybody was counting? How many killed or murdered, how many imprisoned, how many tortured -- if any?

One begins with SAVAK. Formed in 1957, SAVAK, the National Intelligence and Security Organization, was handed far-ranging powers to go with a loosely drawn penal code. SAVAK investigated opponents of the Shah, arrested them, could and did detain them indefinitely without filing charges, and encouraged them to confess.

In the next stage of the legal process, SAVAK switched hats and, in the role of hearing examiner, remanded prisoners to trial after weighing its own evidence. Persons accused of political crimes were sent before military tribunals which, after 1972, tried cases in secret. Guilt or innocence was determined by the evidence in the SAVAK dossiers alone, without witnesses and, of course, without defense lawyers.

It would be surprising in such a system if there were not abuses. But on what scale?

On the basis of the best available figures, it looks as if the shah's arithmetic is better than Khomeini's. In 1976, for example, the shah told Le Monde that there were "perhaps 3,000" political prisoners in his jails. For the same year, Charles W. Naas, a U.S. State Department official, set the figure at 3,700 during one head count. William J. Butler of the International Commission of Jurists (ICJ) says today he doubts the number ever rose above 3,500 or so.

On the global list of political prisoners per million of population, compiled by James D. Seymour for an article in the quarterly publication Universal Human Rights, Iran under the shah ranked 22nd. Some countries with worse records were Cuba, Ethiopia, and East Germany; and, in the immediate region, Pakistan, Oman, and Syria. Other notorious offenders (e.g., Iraq and South Yemen in the Mideast) were lumped in a special unranked category for lack of hard data.

"Political prisoners" or "detainee" as used by such organizations as ICJ, Amnesty International (AI) and the International Comittee of the Red Cross (ICRC) means something different from the way that term is understood in this country. Here, it generally means what AI refers to as a "prisoner of conscience"; that is, someone incarcerated for his political views. The rights groups apply the description "political prisoner" to bomb-throwers and pamphleteers alike, although, in fairness, SAVAK was not always or even usually forthcoming as to the nature of the suspects' offenses.

In interviews the shah was inclined to portray all political activists behind bars as terrorists. Many were. It is clear that some were not, and AI cites "theologians, writers, theater directors, actors, and university teachers" arrested for nonviolent political activities. In one year AI has "adopted" or was considering adopting 114 Iranians as prisoners of conscience. "Heavy contributors to the prison population were Islamic and Marxist guerrilla groups (Mujahedin, Fedayan), and local autonomy movements (Kurdish, Baluchi, Azerbaijani).

It is also clear that prisoners were tortured. The testimony from many sources is overwhelming, including this account from an ex-prisoner published in Index on Censorship:

"It [the torture room] resembles an ancient Egyptian tomb and is reserved for those suspected of being terrorists or accused of having made attempts on the life of the shah or a member of the royal family. Not every prisoner goes through the same process, but generally this is what happens to a prisoner of the first importance. First he is beaten by several torturers at once, with sticks and clubs. If he doesn't confess, he is hanged upside down and beaten; if this doesn't work, he is (homosexually) raped; if he still shows signs of resistance, he is given electric shock which turns him into a howling dog; if he is still obstinate, his nails and sometimes all his teeth are pulled out."

How many died? One hundred thousand, as Khomeini claims? Although the available statistics are fragmentary, the ayatollah's figure again seems wildly inflated. AI apparently did not start thorough record-keeping until 1972. From that date, the shah's government announced the executions of 62 persons for political crimes, according to AI, which thinks the true number was "considerably in excess of 300." However, the organization's official yearbooks show only two persons executed after mid-1977, one the murderer of a U.S. embassy employe and the other a general convicted of espionage.

Another unknown number died under torture, were shot and killed while "resisting arrest," or were taken out of jail by SAVAK and illicitly executed. And some people simply disappeared. "There is no guess as to how many there would be," says an AI official.

The shah himself, in the David Frost interview, put the total number of political deaths at "certainly below 1,000," and Frost said his researchers estimated 1,000 to 1,500 from 1963 to mid-1977. Another 3,000 people, it is thought, died in a 1963 uprising, and 5,000 during the revolution that ousted the shah. Altogether, the deaths from 1963 to the shah's exile in January 1979 come to perhaps 10,000, an estimate endorsed by Butler of the ICJ.

A State Department authority says, "If people want a number, that's fair enough. There's really no way of knowing for sure . . . The thing to remember is that the shah was a Persian king; no better, no worse than other Persian kings. That's the context to look at." Butler observes, "I think [the shah is] way down the list of tyrants. He would not even make the A list."

For a grisly comparison, it might be noted that, in the last decade, Idi Amin is blamed for 300,000 deaths in Uganda, Pol Pot and Heng Samrin for 2 million to 3 million in Cambodia, and Macias Nguema for 50,000 in Equatorial Guinea, a country with a population of 320,000 (or less than one-hundredth that of Iran, where a proportionate number of deaths would be well over 5 million). In next-door Afghanistan, the communist regime executed 6,000 political enemies in the space of a year -- thousands more than the shah, it seems, during his entire reign.

In 1976, which in retrospect was a watershed year, the shah was converted, as it were, by a born-again American president-elect. Even before Jimmy Carter took office, the shah instituted reforms aimed at mollifying the rights-conscious leader-to-be of the Western bloc. In early 1977 he extended invitations to the heads of AI, ICRC, and ICJ to visit Tehran. In personal audiences, he informed AI's Martin Ennals and ICJ's Butler that he had ordered torture stopped, and he challenged Butler to produce a single instance since the previous September. He opened the prisons to the Red Cross.

Butler says the shah promised "substantial changes" in the military-procedures code for trying those accused of political crimes. Shortly after, bills to this purpose were submitted to the Iranian legislature and were passed in August 1977. In October 1977 the House Subcommittee on International Organizations called a hearing on human rights in Iran. Attending were Butler; Charles Naas, State's director of Iranian affairs, and two professors.

Prof. Richard W. Cottam of the University of Pittsburgh, an Iran specialist, told the subcommittee that the shah "had responded in ways that are not simply cosmetic." "Iran is a country in which the Carter human rights proposals have had a major impact," Cottam declared: "The shah is willing to accommodate President Carter's human-rights eccentricity." Butler told the subcommittee the ICJ was unaware of any cases of torture in Iran in the preceding 10 or 11 months.

Naas testified that U.S. government had received no reports of torture in Iran in 1977. He pointedly told about a writer for Belgium's Le Soir who was granted interviews with prisoners rumored by exiles to have been crippled or killed by torture. The journalist had found the prisoners in good health. Furthermore, Naas said, the number of prisoners had dwindled to 2,200 at the time of the hearing. (The Red Cross, whose figures are probably the most authoritative of any because of their exclusive on-scene inspections, puts the prisoner tally at 3,500 for 1977, down to 2,100 for 1978.)

In the event, some of the penal-code changes failed to materialize. Trials remained closed. However, defendants did get the right to a civilian lawyer of their choice and more time to prepare a case. Except for occasional freelancing by SAVAK or the gendarmerie, torture apparently ceased.

The consensus of the watchdog organizations is that, beginning in 1976, Iran's performance in human rights improved markedly.

A notable dissenter to this view on occasion has been Amnesty International. Following a mission to Iran in late 1978, during which about 60 ex-prisoners and their families and friends were interviewed, the organization accused the shah of "gross hypocrisy" and said that torture "has been practiced systematically throughout the country and has not stopped." It bolstered the charge with recent cases -- but only three.

Two months later, presumably with fresh evidence on hand from that mission, AI issued a fuller report on torture -- but, curiously, only for the years 1971 to 1976. A preface to the report did acknowledge that torture "appeared to have decreased since early in 1977."

In December 1979, AI renewed the hypocrisy-and-systematic-torture charge without mention of any lessening. However, New York lawyer David Emil, who led that last AI mission to Iran, has this to say: "It's undoubtedly true there was a big change between '76 and the fall of the shah. It could be characterized as an end of systematic torture. A lot of the more medieval aspects ended. Very cruel tortures were no longer practiced." Prisoners were still subjected to what Emil termed "psychological torture" -- cold and wet cells, random kicks and blows, verbal abuse, deprivation of sleep.

Most compelling is the Red Cross's confidential report to the shah on its inspections of Iranian prisons in 1977 and 1978. After portions favorable to the Khomeini regime were leaked earlier this year, the Red Cross released the full text of the document.

Two visits to Iran by the Red Cross in the spring of 1977 had uncovered complaints of torture and marks on inmates at 16 of 18 prisons, according to a New York Times dispatch from Geneva. Returning in the fall, Red Cross doctors found no new marks, and "virtually all" of the prisoners denied that they were being ill-treated. Trips the next spring and summer disclosed further improvements in prison conditions.

The Red Cross had access to all prisoners for physical checkups and private interviews.

"Things improved in '77 and '78," says Dr. Raymond Gastil, an Iran expert at Freedom House. "He let quite a few people out of jail, and they told their horror stories to the press, which was able to print them since censorship had eased. So it might have looked as though things hadn't improved, but they really had. I'm sure that any torture that went on [after 1976] was ad hoc."

Butler of the ICJ concurs: "I think everybody realizes that things got a lot better, but nobody seems to want to talk about it. I guess it's not fashionable.

They're rebelling against the government, hundreds have been executed by firing squads, and political prisoners languish in jail. In the provinces, a wave of psychological terror has been unleashed. Iran in the days of the shah? No, Iran today.

From newspaper accounts, human rights groups, and well-placed Washington sources who stipulate anonymity, here is a thumbnail sketch of the ayatollah's land, with respect to killings, imprisonment, and torture:

As of late January, "close to 800 known executions" had taken place under Khomeini, far exceeding the number in any like period of the shah's rule. The victims include mainly dissident tribesmen, former generals of the shah's army, and SAVAK agents, but also pimps, prostitutes, and rapists.

Reports received in Washington on the number of political prisoners range from 10,000 down to 1,500. The best guess is "several thousand." In one amnesty, Khomeini let go 3,000 -- more than the total number the shah had behind bars in his final year.

Hundreds of revolutionary militiamen and tribesmen -- perhaps as many as 2,000 or more -- have died in battles as the central government attempts to crush separatist movements in Iran's provinces. One Washington source says the Khomeini regime has instituted a "campaign of psychological terror" in outlying regions aimed at keeping the ethnic groups in line.

"Beatings by the revolutionary committees are very, very commonplace," says this source. Other elements of repression and terror include death-threat letters to influential newspaper editors, summary arrests of foes, and the seizure of suspects' families to flush out fugitives. There have been few allegations of SAVAK-type tortures, and even these few are being discounted. a