However, regular reboots to install updates is only fixing the symptoms instead of the underlying problem. The proper solution is to put security first when writing software. The entire design needs to be developed for security from the very beginning, not added on as a "feature" afterwords.
Additionally, it would also be a good idea to design software components to have minimal interdependence (loose coupling). This should allows not only easier testing, but also easier replacement. Fewer reboots are needed with when you can replace components individually. (it can also limit restarts to only one subsystem)
macOS: not the most popular consumer operating system
The right answer, in my opinion, is to force reboots by default but to allow the option to disable it.
That's likely a pipe dream, as apps do a bunch of complicated things - but it seems like a merger of security and UX. I'm not saying it's possible.. just that it seems like the best compromise.
"Reboot to apply important security updates and to get rid of this message"
Have an overlay of red letters that doesn't impede you to do anything but is kind of an eye sore. Maybe a window that can be moved but can't be hidden. People will reboot to remove that message (but never when they're in the middle of something).
It the moment it's the other way around, in your face when you don't want it and then disappears altogether.
I don't know about other people, but the only time I update is when its mandatory or I magically managed to close out all my work and have no state I care about. I suspect a lot of OS X users are on out of date builds of the current latest version. For the big feature updates they are pretty good about harassing users and do nice things like download the new OS without asking.
Windows historically has been heavily used in botnets, in part because people do not apply updates to known (and fixed) vulnerabilities. Microsoft removing the "fuck off" button was a response to that, and I'd assert it's made the Internet in general safer. Yet it's also unquestionably had the side-effect of making Windows dramatically less pleasant to use.
What's the best solution here? iOS just reboots in the middle of the night, which would likely work well for Windows tablets, but might have issues with traditional desktops, since Windows doesn't have the freedom iOS does to just shut down apps. Linux leaves you to fend for yourself, which I think has mostly worked okay thus far because Linux users tend to be more technically sophisticated. macOS is a bit in-between, attempting to do the midnight reboot dance, but aborting if docs are open.