Don't forget, that it has really been since WW2 that barrels have gotten this short.
Winchester used to market 1894's with barrels up to 30"-32" on their rifles. The 30"+ rifle barrel was not very common, but 24" and 26" were much more common.
As for shotguns...
Many fellers up my way swear by 36" barreled guns from various manufacturers. Besides the Marlin Goose Gun, the Stevens single shots, the Ithaca single shot, Model 12's in 32" and others I can't think of right off...the longest "production" barrel I can think of was on a Marlin 120 with a 40" factory barrel!!!
A couple are for sale on the auction sites right now. I had a buddy with one, and he won a bunch of card shoots with it- that's how I remember it.