I started writing programs in the 1970s, and this isn’t really true.
A lot of interpreted languages like Lisp and Forth would translate the text into an intermediate form ready to exclude, and without the comments.
You are no doubt thinking of (many dialects of) BASIC, where the text representation of the code was what was executed.
But even in that case, the interpreters immediately detected that there was a REM statement, and just jumped to the end of the line. That test was performed for each and every line, so the cost of a comment line in classic BASIC is very small. Certainly it costs far less than a command or function.
I wrote a ton of BASIC back in the day, including an assembler for 6809 that fit into 32K of memory, including the source code, and I did a lot of experiments to make it performant and smaller.
In fact, I did strip the comments out very early, but not because that made any measurable speed difference, but because those comments used up precious bytes in my 32K of memory. (And we’re talking a machine whose speed was around 1MHz…)