This is a very basic implementation on how to replicate a BSOD (Bluescreen of Death), using Python and Ctypes.
python bluescreen.py
I won't go too far into detail as this is pretty basic. We are calling RtlAdjustPrivilege to give our process shutdown privileges. After that, we raise a STATUS_NOT_IMPLEMENTED error with NtRaiseHardError, essentially telling our computer that there was an issue and a status was not completed. This causes a BSOD as when we call NtRaiseHardError, it internally sends a HARDERROR_MSG to the Local Inter-Process Communication Server, resulting in a BSOD.