xienwolf
Deity
One caveat to the brute force method: Make sure they don't drop their starting equipment (if any Abandoning units HAVE starting equipment), but allow them to drop equipment collected by other means (probably be easiest to delete the equipment from their list of starting promotions while deleting the fact it was ever built, and allow the gear to drop on the ground where they were upon Abandon).
MC: Having the unit move to someone else who DOES meet the requirements would require that such a player exists, or temporarily storing all data for the Hero until anybody does meet the requirements again. It also potentially leads to issues with instant city capture if you happen to be at war with the new owners.
You could do a search for people allowed to keep the hero, and if none exist, THEN delete the fact the hero was ever created. And to solve the other issue you could move the hero to the nearest unoccupied tile in the new owner's cultural influence before you convert it to belong to them.
MC: Having the unit move to someone else who DOES meet the requirements would require that such a player exists, or temporarily storing all data for the Hero until anybody does meet the requirements again. It also potentially leads to issues with instant city capture if you happen to be at war with the new owners.
You could do a search for people allowed to keep the hero, and if none exist, THEN delete the fact the hero was ever created. And to solve the other issue you could move the hero to the nearest unoccupied tile in the new owner's cultural influence before you convert it to belong to them.