The fastest way to lock your screen a modern Mac is to use the key combination
Ctrl + Shift + Power 1.
Using an external PC keyboard is a more tricky because it probably won’t have either a power or eject button. To get one working, install Karabiner and remap Pause/Break to Power:

Ctrl + Shift + Break will now trigger the lock.
1Power used to be Eject, but then Macs started shipping without optical
drives.
All content certified human. LLMs are used for proofreading and corrections, but never to generate prose. Did I make a mistake? Please consider sending a pull request.