For the case of Python, source files are compiled before being executed (the .pyc
files), and the comments are stripped in the process. So comments could slow down the compilation time if you have gazillions of them, but they won’t impact the execution time.