When I was growing up in Jakarta, they found two enormous pythons in the culvert right next to the elementary school. They sacrificed a goat to lure them out, then when they were dated they just packed them up and took them to a local safari park. The smaller one was about 21 feet long, while the bigger one was 24 or 25. Just huge.
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.
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...