In theatre scripts, ex (or exeunt for multiple characters) is the stage direction for an exit.
Example: Ex Hamlet = Hamlet leaves the stage.
The phrase To ex, or not to ex?
is a theatre in-joke parodying Hamlet's soliloquy—referring to actors missing their exit cues. "Ex" derives from Latin exire (to go out); "exeunt" = "they go out."
Related directions: Enter (enter), Manet (remains), Exeunt omnes (all exit).