Simply call the function py-underscore-word-syntax-p-off in your config file:
Edited: use helper function instead of setting py-underscore-word-syntax-p-off programmatically.
This can be done, although Emacs doesn't seem to provide useful info about multi-line comment ends, so it needs a hard coded check for */.
(defun my-end-of-comment ()
(let ((state (syntax-ppss))
;; We may be at the comment start, which isn't considered a comment.
(unless (nth 4 state)