Most lanyard have a wrist loop so no need to shut down engine, just remove from wrist. The only time you need it by law is when underway.
underway; not made fast to shore, aground or at anchor.