I dunno what would be a better attempt at self defense against such large snakes, but I think I'd start carrying around both pepper spray and also a stun gun, just in case.
No idea if either would be fully effective, but damn that would be a hell of a way to go, might as well try to be prepared to defend myself.
The one thing snakes like this do quickly is grab and coil around their prey. Everything else is slow slow slow. You’d really need some sort of pepper spray in a breakable tube that activates upon constriction. Hmmmmm….
I used to use rubbing alcohol on my pet snake's nose if he accidentally latched onto me instead of his food. I don't have any idea if that would work on snakes that kill by constriction though
In that case, I'd probably carry around a super soaker water gun loaded with some strong alcohol, and just hope I'd be able to shoot it at a distance before it gets close enough to wrap around me.
Could also in a pinch light the alcohol on fire as a crude flamethrower, packing a double punch...