The Senate overwhelmingly passed a comprehensive anti-drug bill Friday that cracks down hard on casual drug users as well as traffickers and calls for the death penalty against murderous drug bosses and their hired killers.

In addition to harsher penalties for users and dealers, the bill would provide new money for drug enforcement, education, treatment and rehabilitation programs. For the first time, over the next three years, more of that money would be devoted to prevention and treatment than to enforcement.Senate Majority Leader Robert C. Byrd, D-W.Va., called the measure "the strongest and most comprehensive anti-drug bill ever to be considered in this chamber."

Putting the bill's provisions into action will cost $2.6 billion. Senators acknowledged the federal budget couldn't fully fund it over the next two years. Only about $400 million this fiscal year and $1.4 billion next year would be available to cover the bill's cost.

The federal government already is spending about $4.1 billion a year to combat drug trafficking, treat drug abusers and instruct children on the harmful effects of drugs.

In passing the bill Friday, the Senate adopted a non-binding clause that commits it to find the $2.6 billion to finance the measure - even if it takes new taxes - by next May 1. Judiciary Committee Chairman Joseph R. Biden Jr. sponsored the clause.

Senators earlier rejected a move by Sen. Warren Rudman, R-N.H., Biden and others to raise cigarette, beer, wine and liquor taxes to pay for new drug programs.

The Senate bill, which differs in several other respects from an even more far-reaching House bill passed late last month, allots 60 percent of the new money for prevention and treatment and 40 percent to enforcement.

As it moved through the Senate, the bill became a vehicle for several items unrelated to the war against hard drugs. Among them:

-A sentence of 20 years to life in prison for those convicted of child pornography.

-A provision allowing the government to seize all the property of any person charged with committing an obscenity offense.

-A provision permitting the federal government to press civil suits in one state based on a finding in another state that a book or movie had been judged obscene.

-An amendment outlawing "plastic" guns and other weapons that could not be spotted by metal detectors.

-A requirement that distillers put labels on all alcoholic beverages warning pregnant women that ingestion of alcohol could harm their babies. It also would provide a general warning that using alcohol could impair a person's ability to drive a vehicle or operate machinery.

-A sentence of three to six years in prison for persons convicted of bootlegging anabolic steroids, used by some athletes to increase their bulk and strength.

In addition to providing more money for traditional enforcement programs - including international interdiction and eradication efforts - the bill lays down heavy penalties for casual drug use.

Anyone convicted of possessing even small amounts of illegal substances _ such as marijuana, cocaine and "crack," a highly addictive cocaine byproduct _ could be subject to civil fines of up to $10,000.

And, if they were receiving certain kinds of federal benefits _ such as student loans, housing loans or farm loans _ the benefits could be withdrawn by federal or state judges for up to one year upon conviction for a first offense and for longer periods for subsequent offenses.

Persons convicted of selling drugs would risk losing a wider range of federal benefits, such as access to public housing.

"Our target here is the 23 million people who use drugs but are not addicted, casual users who appear to be living ordinary lives," said Sen. Phil Gramm, R-Texas. "By buying drugs, they create the markets and profits that have put a thug at almost every schoolhouse door."

Some complained, however, that strict enforcement of benefits cutoffs would lead to a further clogging of overtaxed courts and deny some users the chance to rehabilitate themselves.

Sen. Arlen Specter, R-Pa., also charged the provision was unconstitutional because it imposed a civil penalty for a criminal act and called for state courts to enforce federal laws.

Unlike the House, the Senate toned down an effort to broaden the authority of police to make searches and seizures of evidence. The House wanted to give thepolice the power to conduct searches without warrants.

The Senate simply codified an existing Supreme Court ruling that allows limited warrantless searches only in narrowly defined instances.

House and Senate conferees will meet over the next several days to try to work out their differences. Sponsors in both chambers expressed the hope that a final bill could be sent to President Reagan for his signature by the middle of next week.

The bill passed 87-3. The three dissenting votes were cast by Sens. William Proxmire, D-Wis., Daniel Evans, R-Wash., and Mark Hatfield, R-Ore.

Evans charged that the bill was constitutionally defective and amounted to overkill in the application of harsh penalties against casual users. Hatfield is philosophically opposed to capital punishment.