If I had to guess, the hard ball could be concentrated urates (pee) and that it is blocking the passage of waste. You can try giving your snake a half-hour bath in 80 degree water as it often helps snakes with their bowel movements. If that does not work then I'd probably want it taken to a vet in your situation. With urate blockages you can sometimes help the snake by gently massaging it out BUT if that's not what it is then you are quite likely going to be doing serious harm to your snake by trying to help it out in this manner. Even if it is urates, I personally don't think you should go much farther than a bath without someone there who knows what they are doing.
Not pooping for 3 weeks should not make your snake look bloated unless you are over feeding it. This might be the result of a internal gut parasite or bacterial infection. If your snake does poop during its bath you should take a sample of the snake's feces to a vet within 24 hours of it being passed (the sooner the better). Ask the vet to do a fecal float to determine if there is anything in there you should be worried about. The float should not cost you more than $20 and is something that is recommended you have done any time you bring a new reptile into your house.