<p>You can use macro recording to do this:</p>
<ol>
<li>Put cursor on the 'd' in <code>def blarg_func:</code></li>
<li>Press <code>Esc</code> to go into COMMAND MODE</li>
<li>Type <code>qa</code> to start a recording macro and store it in register 'a'</li>
<li>Press <code>i</code> to go into INSERT MODE</li>
<li>Press <code>#</code> to enter a literal pound symbol</li>
<li>Press <code>j</code> or the <code>down arrow</code> to go to the next line</li>
<li>Press <code>q</code> to stop recording</li>
<li>Press <code><#>@a</code> to repeat the macro stored in register a. Example <code>10@a</code> to comment out the next 10 lines.</li>
</ol>
<p>So all together the key presses would be: <code>qai#<ESC>jq10@a</code></p>