Is this a hypothetical question or did you stick yourself with a glass pipette after aspirating media? DMEM is a defined media containing various salts, amino acids, vitamins, glucose, pyruvate and pH buffers. It's a bit salty but it has no more side effects than any other salty/sugary concoction one might indulge in. Probably less damaging than carbonated soft drinks. Have you seen 40 grams of sugar?

I would avoid having anything to do with DMEM after it's been used to culture cells. One usually adds fetal bovine serum to the media and there's no telling what's in that. Probably no infectious bugs after heat inactivation but there's the a (small) possibility of prion particles still hanging around.

There might be risks depending on what you were culturing. Many immortalized/transformed cell lines have viruses integrated into the genome.

Probably nothing to worry about if it was an insect cell line and increasing in concern if it was a mammalian, primate or human cell line.

Don't lose sleep over an old line like HeLa or 293. Primary cultures are an unknown.

Worst case would be human blood with transformed hematopoietic stem cells.