You definitely should talk this over with your vet: the weight loss (if & when eating OK) can suggest cancer, & snakes can get tumors just like anything else, but that's
by NO means a diagnosis. If the bulge is further up (not right above the cloaca) it does suggest maybe an obstruction* of some kind rather than "sausage butt" (needing to eliminate), but do get the help of your vet...we can kick ideas around here but it's not the same as being seen.
Hope it's nothing as serious as you fear. How much of a weight loss are you talking about? Do you weight your snake regularly or is this just a guess? And just because the swelling is "near" the kidneys doesn't mean they're involved for sure. If he's possibly just "backed up", it wouldn't hurt to soak him as Lord Sorril suggested, but also in something that allows him to "swim" in place with you supporting him (like your bath tub)...that motion combined with the warmish water will help a snake to eliminate. (sometimes "explosively"- so don't wear your best silk shirt when you do this, lol)