Можно тупо:
(defun fn-comment (&optional shift-left)
"Comment out current line.
When argument, sets comment at most left side of line."
(interactive)
(beginning-of-line)
(when (not shift-left)
(skip-chars-forward " \t"))
(when (not (looking-at (regexp-quote "//")))
(insert "//"))
(forward-line 1)
(beginning-of-line))