Less than three years ago, policemen walking the beat in what was then the relaxed little democracy of Costa Rica were known to carry screwdrivers in their holsters instead of pistols. The screwdrivers were used to remove the license plates of parking violators.

Today the holsters are filled with .38-caliber revolvers, and many of the 7,000 members of Costa Rica's security forces may soon have American M16 automatic rifles slung over their shoulders.

Costa Rica is still a democracy, but it is no longer relaxed.

A handful of terrorist incidents, a collapsing economy, organized crime, fears of domestic political unrest, the increasing violence of the region as a whole and particularly the long shadow of Nicaragua's growing military strength to the north may soon lead this country to create, with the help of Washington and perhaps other Western nations, something very like an army.

No one uses that word, of course. Costa Ricans have a longstanding aversion to so much as the suggestion of conventional armed forces.

Given the coup-ridden history of Latin America, Costa Ricans argue that it is the absence of an army that has ensured the development of their unique democracy.

The democratic Costa Rican system represents politically what the Reagan administration says it wants for all of the Caribbean region.

But there was a major uproar here last August when U.S. Ambassador to the United Nations Jeane J. Kirkpatrick publicly mentioned U.S. willingness to supply "military assistance" along with economic aid to defend Costa Rica from "destabilization."

The matter of arming Costa Rica is especially sensitive since the Reagan administration has sought to isolate revolutionary Nicaragua to the north, regional tensions have grown and Nicaraguan leaders say that any serious military effort to overthrow them would cause violence throughout Central America.

Without an army, Costa Rica would find itself militarily helpless to respond to any serious spillover of regional fighting or a major attempt to mount subversive actions within its borders.

No one here believes there is a threat of an imminent Nicaraguan invasion. The concern is about potential trouble in an increasingly volatile environment and a possible intimidation of Costa Rica.

There is much concern about provoking Nicaragua's Sandinistas and for that reason many Costa Ricans do not want to form an army.

At present, relations with Nicaragua are cool and correct, although among members of the incoming government and on the street one often hears bitter regret about the course of the Nicaraguan revolution, which many Costa Ricans actively supported three years ago.

There is a serious worry that arms supply networks and connections made to aid the Sandinistas in their struggle to overthrow dictator Anastasio Somoza could be turned against Costa Rica.

These concerns combine with dark worries about how far Costa Rica's democracy and pacifism can be pushed given the rising economic and social difficulties.

"The fundamental threat here is external," said Alfonso Carro, who will take over as the minister of government when President-elect Luis Alberto Monge takes office May 8.

But Carro added in a recent interview that "in the cellars of Costa Rican society there are very dangerous elements."

Carro, 58, a lawyer who is often mentioned as a future presidential candidate for his National Liberation Party, said he was impressed with the judgment of a former public security minister who recently told him, "This country is completely unaware of the forces operating beneath the surface . . . completely unaware, really, of the volcano below."

The steady deterioration of the Costa Rican economy has had much to do with whatever rumblings have thus far become apparent.

Crime has risen dramatically over the last three years as inflation has soared above 100 percent by some estimates and the Costa Rican colon, long artifically pegged at 8.50 to the dollar now trades at more than 50 to the dollar.

Organized crime has also moved into Costa Rica. This narrow country not far north of drug-dominated Colombia and just south of the Central American wars has become a major base of operations for cocaine traffickers and gunrunners.

Yet it is not conventional crime that has provoked the current sense of urgency about rebuilding the public security forces, but the growing fear of violent political conflict.

Since Dec. 14, 1980, when a group of former Nicaraguan national guardsmen attacked a leftist radio station in a suburb of San Jose, the tranquility of Costa Rican life has been regularly punctuated by hitherto unknown terrorism.

An attack on U.S. Embassy Marine guards in March 1981 and a shootout in the streets last June that killed five people, including three policemen, shocked Costa Ricans.

Meanwhile, in the underpopulated north of the country, border incidents between Nicaraguan Sandinistas and exile groups opposed to them have been on the rise.

One of the most delicate aspects of the reorganization of the security forces here will be to develop an effective border patrol without creating a force that could supply the Sandinistas with a pretext for action against Costa Rica.

Carro, along with the new ministers of justice and public security, is proposing that the rural guard and the civil guard be combined under the administration of a newly formed Interior Ministry with responsibility for public security activities now under two ministries.

Even before such a consolidation--which is bound to be the subject of prolonged debate--the new government hopes to be rearming and retraining some security forces who now carry, at best, World War II vintage rifles and in many cases have no idea how to clean them.

Carro said that West Germany, Spain, France and Israel are viewed as potential sources of training and supply. He also mentioned Taiwan, Japan and South Korea as countries that "could offer economic and technical cooperation to achieve the objective."

But Costa Rica is so strapped for funds that, as one diplomat put it, "whatever they are going to get is going to have to be given."

At the moment the only country ready and willing and actively participating in such an effort is the United States.

After cutting all types of assistance to Costa Rica's police and other security forces in the late 1960s and early 1970s following criticism of U.S. police training in Latin America, Washington last year began a small training program emphasizing air and sea rescue operations, improved communications coordination and munitions control. Most of the training is done at U.S. bases in Panama.

The budget for the program rose to $50,000 from $30,000 this year and according to U.S. officials here could go "considerably higher" in the near future.

According to Carro and other officials, the possibility of resupplying the Costa Rican forces and giving them such new weapons as M16 rifles, mortars and other relatively light munitions is now being informally discussed and will be taken up substantively after the new government takes office.

In addition, Carro said he hopes to create a whole new intelligence system for the security forces, something he says is almost totally lacking now. Two or three new specialized units are also being contemplated, including a special antiterrorist squad and a revamped narcotics bureau.

No one underestimates the political difficulties of reorganizing Costa Rica's security force. But even political opponents of the Monge government concede the basic need for such a move.

Juan Jose Echeverria, a former public security minister who has close ties to Cuba and Nicaragua, said he has nothing against specialized police units, for instance, as long as they are not "special units" which "have a way of turning into political police."