Some time ago I had a friend caught after 4 years + overstay (I won't go into his circumstances but he was grassed up by an acquaintance) .
He spent one night in the slammer, before the Udon Thani court next morning and because he plead guilty the max fine (at the time was 20K Baht) was halved to 10K and no black ban. He was transported to Nong Khai and allowed to cross the boarder to the Thai embassy in Vientiane, obtained a long term visitors visa and back home the following day. After some time he finished up on 12 month O visa extensions.