My family has some experience with this
My mom's cousin was a wonderful person, her husband, however, was an enormous piece of shit in just about every way you could imagine.
She got sick and died, he never had a funeral for her.
Then he up and died maybe a year or so later.
My mom was still listed as the executrix of their wills, so it fell on her to decide what to do with him.
And she decided on nothing. Let the coroner haul his body away and never claimed it.
After a while they cremate the remains, they hold onto them for a while to see if any other next of kin wants to claim them, then after a while they bury or scatter them somewhere if no one does.
I'm sure the exact specifics of how that all works varies a bit from place to place, but in general that's gonna be an option. They can't exactly force you to pay for a funeral you don't want, and the local government has some plan on dealing with bodies no one wants to pony up for a funeral for (otherwise there'd be a lot of corpses of homeless people and such piling up in a freezer somewhere)