+1 on Loctite/Permatex/whatever blue.
Elsewhere, I read a comment by Jan Heine, who recommends a light smear of beeswax plus correct torque settings.
I'm not surprised at Heine's recommendation.
Beeswax is well known to oil painters as a drying oil, a substance that hardens in contact with air to form an immovable but, for artists more to the point, an impenetrable layer on whatever it is applied to. My friend Marialena Sarris, a Greek watercolorist, applies beeswax (in an artists' formulation, very pricey) over her larger paintings which will hang in galleries to protect the surface without the interposition of glass, among other advantages. The grade of beeswax sold at art and craft stores as pellets is the one you want, and is pure enough; this is presumably what Dan describes using for 40 years in a post above.
The most common drying oil in the art world is linseed oil, available in many versions but the cheap plain version sold in art stores is the one cyclists want. Take care not to buy anything with resin in it to aid faster drying. Linseed is not a new recommendation: the late Jobst Brandt and Sheldon Brown also liked linseed oil for setting bicycle spoke nipples. I find linseed oil a bit slow setting for my oil painting, so I don't have any (except a special formulation which is water-miscible and -soluble that you absolutely do not want near bicycle threads you want to stay put!).
Don't use the cold or liquid wax sold in bicycle shops for chain maintenance; it has all kinds of cleaning chemicals in it which also makes it non-sticky to metal, so that it falls off, carrying impurities with it.
Here's an alternative recommendation from me: Walnut oil from the supermarket is a pure ingestible grade and cheap, a couple of sponduliks for 250ml which will last forever -- well, that's if your family doesn't grab your bicycle setting oil for salad dressings. Mine is particularly popular because it is smokey to make my bike smell good as well as look good, just like my paintings. Do not buy your walnut oil at an art store: it may have resin in it, which will set that thread so hard, you'll deform the frame trying to get it out. In any event, art store walnut oil is several multiples the price of the same oil at the supermarket. Walnut oil is also cleaner than linseed oil, in that it attracts less filth. Note that my recommendation of walnut oil, especially the smokey one, makes a thin, pale green-brown ring around the screw, so that if you can see the screw's open end, you can tell in what condition your locking agent is, which is useful on critical fasteners for those of us who don't do annual or biennial disassembly maintenance.
If cleanliness is your thing, a pale, very clean drying oil is poppyseed oil, used for setting white and light colour oil paints. It doesn't discolor (to yellow) like linseed oil, or show a base tint like walnut oil, and it isn't yellow-white like beeswax. However, it is the slowest of the main setting oils to set, so it may be a couple of months before your screw is truly locked.
For those of you who will now wander into art stores to see what else is useful for cyclists, the oil paint varnishes will also set your bike's screws -- forever. Stay away from them, even if the bottle or can doesn't list "shellac" among the ingredients. And it doesn't matter whether a resin is synthetic or "natural, rubbed on the thighs of African virgins", you don't want anything with resin near your bike except in the paint on it (where it is probably illegal these days).
All the recommended drying oils in this post are for threads you don't want to shift until you deliberately apply considerable loosening torque to them.
I don't even have a tube of general "blue" threadlock, or the Rolloff-friendly stuff Dave told us comes from the factory on the Rohloff service stud. However, these drying oils aren't so smart on the Rohloff stud because eventually bits of hardened drying oil will break off and fall into the gears. I reuse studs until the factory application has worn off, then start a new stud. No leaks on my Rohloff.