When I did long some long distance sailing, a good tip was to train your dog to do its business on a square of AstroTurf on deck. The astro turf square was tethered to the boat by a line, so when it had been...deployed, it was chucked overboard to sluice off, then pulled back on deck.
Which sort of avoided shi**ing hazards.