Having spent many decades single handling, I have "after bow spring lines" (as Boris shows) at the ready always. Even though others frequently go with me, this avoids surprises and last minute hollering.
As mentioned you have to be careful that these lines are either tied tightly enough so as to not rest on the side step ledge, or loosely enough to drape below that walkway.
Another key ingredient to saftety in going forward is to wear VERY GOOD, HIGH QUALITY, DECK SHOES - specifically designed for walking on wet, moving decks. I have tried even medium priced deck shoes that turn into water skis on a bounding, wet deck. Also, periodically wash the soles with Dawn detergent or an organic solvent to make them stickier.
If you are genuinley worried about it and must go forward or lean overboard in rough water, get a safety line to run fore and aft and the special harness/life jacket with the D ring and coiled lanyard to clip onto the safety line. Keep your feet parallel to the long axis of the gunwale, don't try to tippy toe. Use both hands, and plan on one foot slipping as you make way forward. As mentioned, lean hard against the cabin top - I try to keep the cabin roof edge in my armpit, resting heavily upon the upper arm, so very little weight on the feet and very little risk if a slip comes.
If you are carrying things fore and aft, rest them on the cabin top and keep a lanyard on them so you are not tempted to try to grab them if they slide loose and you can just tug them along as you move without have to hold onto them or balance holding them.
A local 44 year old "hero" around here was in the process of saving some kids who were stuck on a dam with their Seyvelor raft during a flood lost his glasses and was killed when he reached down to grab them, even though he had two safety lines being manned on the shore. He reached down to grab the falling glasses, slipped, hit his head and drowned before they could pull him ashore.
Woody, an old, retired Merchant Marineman who taught me much about boats and the sea always said, "Always put a lanyard on anything you care about." So, as I lost valuable items overboard here and there, he'd remark, "'Guess you didn't care much about that..."
And that goes for ppl too.... life jackets, safety lines in rough seas, etc.
Prepare in advance and plan for slipping, dropping and mishaps. If you wear glasses, even only sunshades, keep the floating headstaps on them. That quick reflex to reach down and grab them could wind you up in the drink.
John