no need for scram to be a c program and duplicate the acpi shutdown code. try writing power off to /dev/pmctl or fall back to the new -H flag for aux/acpi.