I don’t think you can directly prevent it. Some BIOSs allow to preselect the video output, so you could set that to an unused output and switch the output later programmatically. It’s probably easier when you have both integrated graphics and separate a graphics card (between which you can switch). A simpler possibility may be to attach the monitor to a power strip with IP control, which you can switch off before the restart and switch on again after the restart.
Comments
I don’t think you can directly prevent it. Some BIOSs allow to preselect the video output, so you could set that to an unused output and switch the output later programmatically. It’s probably easier when you have both integrated graphics and separate a graphics card (between which you can switch). A simpler possibility may be to attach the monitor to a power strip with IP control, which you can switch off before the restart and switch on again after the restart.