If it's mandatory if you want to enter the EU (as a non-citizen), I'd guess they would deny you entry.
That's the point. If you refuse then they do a thorough search.
If you answer suspiciously, or refuse to answer, then you get the full search.
This is similar to how you can refuse body scans at the airport, but if you do then you get the full pat down search.