ASTM D3311 specifies that the trap of a 1-1/4" p-trap must sag at least 3-3/8" from center of outlet to center of the trap's low point. ASME A112.18.2 prescribes performance standards instead of actual dimensions, so you might be able to find a shorter yet still conformant p-trap by scoping your searches with "ASME A112.18.2".
To avoid siphoning, the pipe can fall no more than its diameter before it reaches its vent. Assuming that the trap sidewall thickness is the same as the pipe's sidewall thickness and assuming that your drain's vent is immediately behind the wall, then, the lower edge of your pipe at the wall outlet must be higher than 3-3/8" - 1-1/4" = 2-1/8" to avoid siphoning.
Your wall outlet is obviously too low, so it looks like you're stuck cutting into your wall. Unless you can find a short trap that conforms to ASME A112.18.2, but I'm pessimistic on that prospect. With a hole saw and some precision, you could cut the shelf nicely. I suspect that 2 well placed holes would allow installation of the trap going through the bottom of your vanity without connecting the holes to make a slot. The AAV from your linked question is also an option, of course.