Why would the shape help you float? Shape has no effect on buoyancy, only density.
@freemo stability while afloat is a function of shape. Being less dense than water is no good to the poor capybara if it has to spend tons of energy trying to avoid rolling to a nose-down position. Hippos are similarly barrel-shaped.
@freemo it's only laterally symmetric, but longitudinally it can still provide stability. Suppose the legs are enough ballast to keep it from rolling - the barrel shape just has to provide enough resistance to pitching to counteract the weight of the head and stop the animal from tipping forward.
Also airplane fuselages are just cylindrical because that's the easiest shape to design a pressure vessel in. It would certainly be convenient to have a rectangular cross section from the perspective of volumetric efficiency, but it'd have to be far stiffer and thus heavier. Planes that place a higher premium on aerodynamic efficiency - fighter jets, aerobatic planes, gliders - don't generally bear much as resemblance to a barrel.
@khird Ahh your talking about forward tipping, I was thinking of rolling... Ok yea that makes more sense, elongation allows for less equal distribution on that axis.