Enable_if_Disabled = "yes" # provide yes or no

Disable_if_Enabled = "no" # provide yes or no

import _winreg

def Check():
    with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"SYSTEM\CurrentControlSet\Control\Session Manager\Power", 0, _winreg.KEY_ALL_ACCESS) as key:
        existing_path_value = _winreg.QueryValueEx(key, 'HiberbootEnabled')[0]
        return existing_path_value

def modify(value):
    with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,"SYSTEM\CurrentControlSet\Control\Session Manager\Power",0, _winreg.KEY_ALL_ACCESS) as key:
        _winreg.SetValueEx(key, "HiberbootEnabled", 0, _winreg.REG_DWORD, value)

Status = Check()

if Status == 0:
    print("Fast Startup is disabled on this machine")
    if Enable_if_Disabled.lower() == "yes":
        print("Enabling Fast Startup")
        modify(1)
        print("Successfully Enabled Fast Startup")
elif Status == 1:
    print("Fast Startup is enabled on this machine")
    if Disable_if_Enabled.lower() == "yes":
        print("Disabling Fast Startup")
        modify(0)
        print("Successfully Disabled Fast Startup")
