The iOS equivalent is to hold the side + volume button until the power slider shows up. Cancel out of it and the next unlock will require your passcode. Pressing the side button 5x triggers Emergency SOS which does the same thing. Been there forever but barely anyone knows about it.
Nice to see something like this on the Mac side.
Or IMO easier: press the on/off button 5 or more times in rapid succession.