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.
@khird While i do agree that the shape can effect orientation in the water, I would disagree that is due to barrel shape. A true barrel shape is symmetric and thus would not allow for better stability.
Barrel shapes are known to be optimally aerodynamic shapes (see planes, and blimps) and thus would be more suited to making swimming more efficient in that sense I would imagine. That is also the reason, I suspect, a hippo is barrel shaped, for aerodynamics in the water.