Again, and gazillionth time, such assumption about *pitch and roll averaging to 0* is not needed!

Assumption about long-time ACCELERATION (other than the gravity) being zero is done. Exactly because that way we can assume the long-term average of the accelerometer is just gravity, and only gravity. With that assumption, we can easily calculate the long-term pitch and roll from the direction of the gravity vector directly:

roll = atan2(acc.y, acc.z);

pitch = atan2(-acc.x, sqrt(sq(acc.y)+sq(acc.z)));

Sailing a boat at constant 20 deg roll does not cause any meaningful long-term acceleration. If you sail at constant 20 deg roll, accelerometer averages to the gravity vector showing exactly that 20 deg roll no problem whatsoever. Gyro can be then used to catch quick transients and keep the estimate responsive.

If you don't trust me, and trying it with actual MEMS is too difficult, try it with any old bubble level, bring it with you on a boat and it doesn't stop working even if you sail at 20 deg roll for a week; it's an instrument which shows *acceleration*, so it shows gravity reliably, except for disturbances from sudden non-gravity accelerations. You can average it out by eyeballing.