Am I missing something you dont want to go through immigration what you think you are going to do go under the fence you must pass muster through immigration with any country you you visit
Your overstay shall be recorded and listed on thai immigration system I would most certainly get a paid tourist visa before returning to Thailand BUT that doesn't guarantee you return entry you will pay for the visa before visa is granted and your application can be refused and the money is not refunded if you do make it back upon check in at airport immigration you're entry will be answered by the IO whom sits in front of you and he or she also can refuse you entry if he or she doesn't like the way you brush your hair you may have wasted money on airfares it's not a guaranteed entry for anyone technically there no written law for entries by air but you can only get 2 extension and or border crossing in a calendar year Chokh di you may need it
There has never been a 45 day tourist visa for Australians it's always been 60 day tourist visa you apply for before coming to Thailand or 30 day visa exemption which is only a stamp in your passport its not a 30 visa the 45 days visa exempt ended 31st of march 2023 and why you would plan 40 day stay when the 45 days visa exempt was never going to be extended past 31st of march you have 3 options get 60 day paid visa prior to your departure at thia consulate or embassy or 30 day extension 1900baht thia immigration in thailand or overstay 10 days and pay the fine 500baht per day overstay and you will be flagged in your passport and in thai system as overstay not a good option as thai girls say upto you Chokh di