It would depend somewhat on where I hunted and the type of terrain I regularly navigated. Trying to decerne the 'optimal' length is impossible as a western mountain hunter is going to need a very different rifle than someone hunting here in the South Texas brush country or the dense forests of the Pacific Northwest. I have a 26" tube on my 300wm and I run a 7" suppressor on it. If I were building one I might cut it back an inch but then, how much difference does an inch make?? [insert any number of crass jokes here!] LMAO!! Seriously, though, I just don't think an inch or two is really going to make a rifle more comfortable or easy to carry. The 300wm is just not suited to short barrels. If you want a compact rifle (which I love) in .30 then get a .308 that's perfectly suited to 16"-20" barrels. If you want to shoot a magnum cartridge, with all that powder to burn, wrap your head around a longer barrel and get the longest one you think you can stand.
As somebody else pointed out, I would recommend going with a Bartlein #4 (or bigger) rather than a 3b, if you're going to thread the muzzle.