With or without the valve, none of the surgical masks or the typical masks you typically see people wearing, with the exception of something like a filtered respirator type mask is going to keep a person’s breath from exiting the seal between the wearer’s face and mask unfiltered. The restriction on valves masks is nothing more than an example of some official trying to “outstupid” some other other official for yet another useless feel-good measure.
As for keeping your glasses from digging up, if you wear your mask so that the top edge of the mask rests between your face and the bottom frame of your glasses, your breath which escapes your mask will act like a defroster, keeping the fog off your lenses. Keeping your lenses clean also helps.
You could also switch to contact lenses or if your vision is not that bad, just don’t wear your glasses unless you really need to. Luckily for me, my vision is not that bad so I don’t wear glasses while I wear the mask.