Detailed photos. Thank you.
It looks like you need to take it to the vet. While I have not seen that in Ball Pythons, I have had to deal with something similar in Rattlers. It APPEARS to be stomatitis with the infection and/or swelling extending into the sinus behind the heat pit forcing the membrane of the pit to become exposed.
Here is a Canebrake that was diagnosed with the above. It seems to be very similar.
A vet wil probably recommend antibiotics. Usually Baytril is the "catch all" antibiotic used by vets. If so, he will probably recommend injections. However, Baytril has better pharmacokinetics when administered orally.