This google app script purges gmail emails (so they are not even in Thrash bin) older then certain number of days. This script requires advance settings enabled for GMail under project resources.
I tried to find a script which does it but couldn't so wrote it myself. Hopefully it helps others who are looking for a working example.