I'm a programmer, and therefore entitled to have an opinion: use the second way ("break all" wrapping).
Why? Well, there are several reasons. First of all, the first option won't always be accessible. Someone will come up with
another_veeeeery_long_function_name, which won't fit on the line even if there is nothing else on that line.
Secondly, in programming languages (especially Python) white-space is important. In particular, in Python each newline starts a new command, therefore inserting newlines liberally really hurts readability. In the first example I would have guessed that
def by itself is meaningless, so probably a word-wrap have occurred. But there are examples when the wrapped expression may be misinterpreted as two separate commands: for example, consider
x = 1, very_long_function_name() (in this case
x = 1, would be a perfectly valid statement which creates a single-element tuple). Of course, line numbers and stripes add some cues as to the line boundaries, but visual appearance of a line running into the window boundary is a much stronger cue.
Now, there is of course the concern that identifiers broken at arbitrary points will be unreadable. To improve affordance, I'd suggest the following three changes: (1) reduce the interline distance within the word-broken line (so that line distance between "logical" lines is larger than interline distance between "visible" lines). (2) add hyphenation marks (or any other marks) indicating that the identifier was broken — this should be unambiguous since in most languages identifiers cannot contain hyphens, and their color shall differentiate them from the minus signs. (3) wrapped lines should continue at the same indentation level, so that block boundaries can be easily followed.