DIY protection for 12V electronics wired directly to a marine 12V battery system
The damaging event that you are concerned with is called a Load Dump.  It can expose electronics to greater than 100 volts for hundreds of milliseconds.  They happen in automotive environments, and I assume in boats too.

Most semiconductors are not designed to handle 100+ volts in, which is why a "simple" DC/DC switching converter (a.k.a. Boost/Buck converter) will not survive in this environment.

Some people will claim that using something like a TVS (Transient Voltage Supresser) diode will protect you, and it might.  It also might blow up.  You need something to help limit the current too.  I would start with an LC filter followed by a TVS.  But, and this is huge, you must simulate the circuit to make sure it will handle those voltages correctly-- without damaging any electronics you have connected but also to make sure you don't damage the protection devices themselves.