How to turn off an external display without disconnecting?
There are two solutions I can think of:


SwitchResX
Power plug adapter with remote control


SwitchResX has a number of features including "disable display" which should deactivate it until the software  turns it back on.  From their FAQ:


  SwitchResX includes a function to remove a display from the System's
  list of managed display. This means the display in question, once
  deactivated, will not be visible from the System or from any
  application. Only SwitchResX will be able to activate the display
  again.


Another simple solution is to use a power plug with a remote switch.  It's an easy, non-invasive solution that will get the job done without having to install software or have daemons running that could interfere with your display.  macOS will not detect the display if the power is cut (though it will if it's in "standby" or "sleep")



Both solutions cost about the same (less than $20USD).  SwtichResX has a 10 day free trial and the power adapter comes with a 30 day return.  The software has the benefit of being elegant; but the switch, though a bit crude, has the advantage of you knowing for sure you display is disabled because it's physically off.