There's a good bit of this stuff in records of the 1930s and 1940s, mostly blues and jazz releases. Enough of it that Stash Records, in the 70s, was able to put out at least half a dozen LP compilations of "Reefer Songs," "Viper Songs," "Pipe Spoon Pot and Jug," and the like. Nearly all of it is dope-oriented, and almost none of it is unfriendly.
Among the songs which come to mind:
Who Put the Benzedrine in Mrs Murphy's Ovaltine?
Reefer Man (Cab Calloway did this, and other similar pieces, including Kickin' the Gong Around, Minnie the Moocher, and The Man from Harlem, who brings joy to a dull nightclub by showing up with the Stuff)
If You're a Viper ("Dream about a reefer, five feet long/Mighty mezz but not too strong/You'll be high but not for long/If you're a viper")
Wacky Dust (Ella Fitzgerald)
The Stuff is Here (and It's Mellow)
Light Up
The "G" Man Got the "T" Man (and Gone)
Jerry the Junker
Weed Smoker's Dream
Dopey Joe (from Kokomo)
Stash also did a couple of excellent sex collections, Copulatin' Blues and AC/DC Blues (Gay Jazz Classics).