As far as I can tell, the "dead" flag's function is rather one of "inactive" (which is a better name), as the flag is set on units arriving (visitors, invaders, critters) as well as ones leaving that have left the map but not the "fortress". The unfortunate name of the flag leads scripts (fix/dead-units.lua for instance) to treat units with that flag set as if they actually are dead (which, as far as I've seen so far is represented by unit_flags2.killed, although I don't know if there are cases where dead units don't have that flag set).
Renaming the flag to "inactive" would cause plugins using it to fail to compile (easily detected) and scripts using it to fail to work (a bit harder, as it requires active searching). However, each case where it IS used ought to be reviewed to ensure it is used in its actual capacity, not as an if it was an indicator that the unit is actually dead. Keeping the current name is likely to cause further harm as scripters will continue to assume the flag's function matches the name, in particular since the "killed" flag is buried in flags2, so scripters are likely to stop looking for suitable flags when "dead" is found.
As far as I can tell, the "dead" flag's function is rather one of "inactive" (which is a better name), as the flag is set on units arriving (visitors, invaders, critters) as well as ones leaving that have left the map but not the "fortress". The unfortunate name of the flag leads scripts (fix/dead-units.lua for instance) to treat units with that flag set as if they actually are dead (which, as far as I've seen so far is represented by unit_flags2.killed, although I don't know if there are cases where dead units don't have that flag set).
Renaming the flag to "inactive" would cause plugins using it to fail to compile (easily detected) and scripts using it to fail to work (a bit harder, as it requires active searching). However, each case where it IS used ought to be reviewed to ensure it is used in its actual capacity, not as an if it was an indicator that the unit is actually dead. Keeping the current name is likely to cause further harm as scripters will continue to assume the flag's function matches the name, in particular since the "killed" flag is buried in flags2, so scripters are likely to stop looking for suitable flags when "dead" is found.