Amstrad CPC Basic, 7 keypresses.
Amstrad CPC cannot be physically shut down by software, but system can be reset with this BASIC call:
How it works
At the beginning of memory (either RAM or ROM, both are prepared for this), there is a table for Z80
RST instruction. These instructions, related to Z80 interrupt handling, are also used (even on machines other than Amstrad CPC, like TI-81) for other tricks because one-byte long assembly instruction is enough to reach any of the 8 entries.
On the Amstrad CPC they are used to space-efficiently call code in ROM, RAM, expansion RAM/ROM, see BIOS Function Summary - CPCWiki or ref page 8+. This is used extensively to make RAM-based indirections that allow easily calling ROM routines from RAM (even from BASIC, like
call &bd19 that waits for screen refresh) and also, by changing them, modifying system behavior even though system is in ROM (like changing how text is displayed, or even redirecting it to printer by changing two bytes of RAM). See
BB00 and following in BIOS Function Summary - CPCWiki or Firmware Guide
Entry zero jumps to a ROM-base routine that performs full machine reset. The simplest way to call it from BASIC it
If you insist on a program that can be run rather than a direct command, it takes 8 keypresses:
Then you can
Can I haz test?