But, personally in general (car camping especially) I like the humble pee bottle. At Walmart in the RV section they have the blue chemicals used in portable toilets and plane lavatories and the like. You can get it in a little tide pod format. Cuts the smell and keeps things sterile. Drop that into any container (preferably non-translucent and 2+ liters) add a little water and you've got your own miniature portable toilet.
You can also buy a real portable toilet, they are quite nice these days, but can be bulky. The keyword to find them is "cartridge toilet" because typically the waste volume is a container that is detached and carried to the dump point. I once hiked 3 miles holding one of these portable toilets just so I could take a dramatically scenic (and civilized) poop and it was absolutely worth it.
Too bad if there's some humor in it. You have to live with that sometimes.
The head. If there isn’t one, give a buddy a heads up.
Really if you ever need to go the edge of the boat you should be tied in. This is especially true with sailboats since you often work at the edge of the boat doing things like pulling lines or other actions where you can easily lose balance or the boat can quickly shift.
If you are sailing in open water like this, miles from shore, especially solo, you should be tying yourself whenever you go to the edge of the boat. This is standard equipment on most boats, a full-body harness (often intergrated with an CO2 inflated life vest and water activated beacon). There is a big industrial caribiner style clip you clip onto the railing or similar with so that if you fall overboard you can pull yourself back. The rig is similar to what you would wear while roofing a house.
This applies to all offshore boating, but if you are ever boating solo, even more precaution should be taken to do this.
Gatorade bottle (the dude even had his own supply according to TFA)
Worst case, on deck near the drain holes, then wash it off