The kernel provides an interesting feature dubbed Magic SysRq: essentially, certain keyboard key combinations (or accelerators) result in a callback to some kernel code. For example, assuming it's enabled, pressing the Alt-SysRq-b key combination on an x86[_64] system results in a cold reboot! Take care, don't just type anything, do read the relevant documentation here: https://www.kernel.org/doc/Documentation/admin-guide/sysrq.rst.
Let's try some interesting things; we run the following on our Fedora Linux VM:
$ cat /proc/sys/kernel/sysrq
16
This shows that the Magic SysRq feature is partially enabled (the kernel documentation mentioned at the start of this section gives the details). To fully enable it, we run the following:
$ sudo sh -c "echo 1 > /proc/sys/kernel/sysrq"
Okay, so to get to the point here: you can use Magic SysRq to invoke the OOM killer!