To add in-code comments, I often use an "empty" custom block that has one input parameter. The comment is simply typed in as an argument to the "function". The block does nothing, but "calling" it requires the operating system to load and pass the entire text string to the function. I wondered if running that "empty" function caused a performance hit. To test it, this project runs two (update - now three) tests (each looping 1,000,000 times to accumulate some time). One calling the comment block. The other enclosing the block in an "if" statement with a false input. Even with the cost of running the if statement, the second method is measurably faster. A new third test runs a comment block with no definition (see Notes). Strangely (to me), the 3rd test runs slower than the 2nd. ?? See inside.
Update 2026-04-21: Thanks to @Yoshiii999 for the idea to use a comment block with no definition (definition is in another sprite).