Wikidata provides a tool for query building.
But I cannot find any shortcut in the editor to comment/uncomment in bulk (that is, comment/uncomment multiple lines at the same time).
As of June 2018, the SPARQL query editor at https://query.wikidata.org/ lets you select several lines and type Ctrl+/ to bulk (un)comment. (This feature was not available when the original question and answer were written.)
The SPARQL language does not have a "multi-line comment" indicator, only "the rest of this line is a comment" hash/octothorpe/pound ("#
") indicator.
Some text editors will let you add the same prefix to multiple lines with one command; this requires that you edit your query outside of most SPARQL endpoint webforms.