Odds are that an unexpected death will occur inside territorial waters and within a day or 2 of shore at most.
Therefore I would be first onto the Radio
to inform the local authorities of a) the death and b) my intentions - particularly my next port of arrival & ETA.
Hopefully would mean that upon arrival that arrangements were in hand (both the practical on the body and the paperwork). Could even mean that someone would come out and transfer the body to shore. The good news is that wherever you are in the world their is a lot of it about - so always some locals well versed in dealing with the dead person stuff.
If I had a day or 2 until port would seal them up and keep 'em on the aft deck
. If I had any contacts onshore would use them to help smooth the arrival by contacting the relevent authorities / an undertaker etc.
FWIW flying a body home is horrendously expensive even (especially?) from the 3rd world. Talking IRO $10/20k. Me Missus got on the plane in a pot
not exactly dust
- but small enough that didn't attract any request for transportation paperwork. When talking things over with a loved one IMO would make sense (in $$ terms and for far less aggro / time stuck abroad) to get them to sign up for cremation - on which note, I will mention that cremated folks can still get interred into a grave plot (unless your branch of Woo objects) same as a whole body - i.e. with a headstone, doesn't automatically mean you have to have a scattering. Oh, and Cremations don't always / have to end up with dust. There is a bit of a process to it all to arrive with dust.......I "decanted" me Missus from the Crematorium into her pot by hand, lots to bury. a few bits could probably be re-assembled...........fortunately I don't drink so much anymore.
Mid Ocean (and especially no radio
contact) would be a make your own rules up - but I would hang onto them for a couple of days / as long as practical whilst attempting a radio contact, even with only a passing ship.