netbase: Use .data() instead of .c_str() on binary string

`.c_str()` is only guaranteed to return the data up to the first NUL character. This could break Socks5 negotiation on some platforms.

Also remove a few redundant c_str() in logging and formatting.