Why don't they have a more hydrodynamically shaped fuselage underside?
Because it wouldn't help emergency ditching much. All that matters is that the hull stays in one piece long enough to protect its occupants, and changing the shape of the hull would more likely compromise its strength than improve it—a tube is excellent shape for strength.
Specifically for the aircraft that have their engines mounted under the wings, isn't this too dangerous for ditching? As far as I understand when an engine touches water during ditching the whole aircraft would/could break apart?
The whole aircraft probably not, since the engine mounts are the weakest points. If the fuselage does not break in two, anything else that shears off is actually absorbing the impact energy and therefore rather beneficial for the occupants. And the aircraft is going to be written off either way.
The engines are also very dense and heavy, so applying the braking force to them actually produces less stress in the structure then applying it elsewhere.
Or, couldn't they have some kind of (retractable) floats?
It wouldn't help either. If the water is calm enough, the fuselage is strong enough to withstand the impact and deceleration, and seaplanes can't land in much of a swell either. In fact in a swell floats make things worse, because they raise the centre of gravity, so the aircraft has greater tendency to roll over forward and it can't survive hitting the next wave at too steep angle.