I think it's time to clean this up by removing the rel from the planner data structures altogether. The attached passes check-world, and if it does trigger any problems I would say that's a clear sign of bugs elsewhere.
+1. The patch looks good to me. One minor comment is that we should also remove the comments about RELOPT_DEADREL in pathnodes.h.
* Lastly, there is a RelOptKind for "dead" relations, which are base rels * that we have proven we don't need to join after all.