Earlier quoted context omitted.
Many editors allow you to select the section and line-comment it as a whole.
Even vim has a visual block selection mode. at the top of the block, then move down (j or down arrow) to the bottom. That marks the block. Then type the I character (insert in front of cursor), type the comment character, and press . Once you press , the inserted comment character action is repeated for the whole block. Or non-visual block select...V% with cursor on the opening {.
:vmap :s|^|//|
:vmap :s|^//||
(writing from memory, may need tuning)