I use WD40 as a cheap cleaner, not as a lube. And if you think 3-in-1 gums up over time, spray some WD40 in a cup and put some real gun oil in another cup, and let them sit, checking them maybe once a week. As the solvent in WD40 evaporates, the water displacement wax gets gummier and gummier. A decent gun oil stays fluid.
WD40 and 3-in-1 are good for certain applications, or they would not still be around, but they are just not substitutes for a dedicated gun oil.
ADDED: Gun oil is formulated NOT to oxidize and form a varnish over time. My first and I hope my last experience disassembling and reassembliing the lockwork of a S&W, was when I encountered a Chief's Special that had belonged to a retired relative: the gun would not fire and the oil inside the lockwork was a brown, hard varnish. The original owner was deceased and the gun had not been fired after retirement--may be ten years. It is worth it to spend a little extra for the good stuff, especially for long term storage.