I've heard of people in the UK heating vasoline carefully on the stove until it's hot enough to melt into a liquid, then you brush it carefully onto any exposed section of metal that can rust. It'll look like ass as stuff sticks to it, but it'll stop the rust... seems pretty desperate to me though.
After over 40 years and 750,000 miles, and over 40 UK Winters, I've never had to resort to anything like that.
Alloy parts are best paint stripped to remove the protective lacquer. Naked alloy only needs a wipe with a damp cloth to keep it clean and shiny. The lacquer gets chipped and corrosion starts to spread underneath it where it can't be wiped or polished off. That's why I remove it.
Chrome and paint just need to be kept clean. A good quality wax polish is better than anything else on paint, and pretty good on chrome. Otherwise, ACF 50 for chrome, and for any bare metal. WD40 is ineffective. It's meant for electrical parts, not general protection or lubrication. By driving of moisture it can actually increase visible salt deposits, but out of solution the salt is less corrosive.
Don't use any heavy oil or grease on locks. It gums up the mechanism. WD-40 if you have nothing else to get one working, but 3 in 1 or a specialist product is better. Lock lube or a similar specialist lock product is best for keeping the lock operating. That's for the actual lock mechanism. Latches, cables, etc operated by the lock are best lubed with a light machine oil.
The problem with many bikes is that moisture can get inside frame and swinging arm tubes, which aren't protected. ACF 50 sprayed inside is the long term answer here.