You can make safe edible cookie dough pretty easily . The eggs aren’t the only issue, it’s the flour itself. If you bake it at like 275F for 30 mins in a sheet pan it’ll sterilize it. For edible cookie dough that won’t be baked you don’t even need eggs.
Having said that, I too have eaten my share of regular cookie dough.
Had no idea raw flour wasn’t safe. The store bought safe cookie dough always tastes like cardboard to me
Starting with my grandmother, I’ve been warned by the various bakers in my life for about 50 years that the various kinds of raw dough I have wheedled them into giving me or snuck off of their work area will give me a stomach ache or cause other issues. The most recent time I was warned in this way was surely less than 2 months ago.
So far so good, not a single problem, and I never pass up a chance to eat uncooked batter or dough. (Edited to add - if you haven’t tried basic homemade pie crust dough you haven’t lived. It’s not sweet, it’s just good.)
I am absolutely not saying the risk doesn’t exist, but the chance of it seems so minuscule (based on my anecdotal lifelong experience) that I only ever think about it when someone brings it up.
If I bought something prepackaged on a grocery store shelf, like from nabisco or whatever, that was undercooked, I wouldn’t eat it. From the kitchen of a relative or right from a bakery - has never given me pause.