Judging from the history book accounts of gunsmithing, octagon barrels came about as Polinese said.
A way to make thick barrels before the modern age.
They sure look cool, though.
I kind of miss my Dad's old Winchester rimfire that had one.
Shouldn't have lost interest in .22s in my youth and let him sell it.
Ditto for letting another relative sell their Browning lever action rimfire with one.
But back then, if it wasn't at least a .38, it wasn't considered a real gun.
Oh, the ones that got away........