Are we only talking about the 40mm f/2.8 pancake? I recently bought a filter for the EF M 22mm f/2 lens. The lens cap prodrutes out a bit making it not so pocket friendly so I'm trying a filter on it so it's always ready to shoot. It only adds a few mm more. For pancake protection a filter seems the way to go. Keeps the profile low and protects the front element.
Edit - if I had a 40 mcshorty I'd go capless, hoodless and filterless i.e - bare.