Many of us have offered Thailand visa advice on here on TP. I have always cautioned against getting into an overstay situation while in Tland. The Thais take overstay very seriously and all visitors should as well. I found this article on another forum. Mr. Melmblom thought he did the right thing by going to the police station to report his overstay status. Did not turn out way.
This is scary stuff. Seems like the police just seized the opportunity. Then it looks like the wanted him out of Dodge before he could raise too big a stink, pardon the pun.
It's really strange how the ThaiVisa gang seem to think there is "more to the story". They are usually all over the Thai authorities. I guess Swedes don't count!
In Bangkok, many hospitals can help with the visa considerations.
Living in BKK, you know all too well how corrupt the police can be. The Pattaya police saw a payday and took it. Melmblom tried to do the right by reporting his overstay situation and gets jailed and fined for his effort. Great publicity for a tourist city.
I used to take water and food to US guys stuck in Pattaya's jail when I was with the Pattaya Ex Pat Club. I have seen how terrible the conditions are in that jail. All TP members should make sure they do not get in an overstay situation.
It is easy to forget that Thailand is a third world country effectively ruled by the military.
If you overstay, pay at the airport (500 baht per day or part day).
Anywhere else, they can and will arrest you for overstay.
As said, the police are corrupt so you can ask "if there is a fine you could pay", which is of course, a bribe, and hope the cop doesn't get too greedy.