Cant get much better than millions of years of try and die I guess. Mother nature is pretty crazy! We should copy her work more often :)
You experience them as painful because your teeth don't rot as they used to; until the XX century, it was common for people to lose many of their teeth by the age of 30, so they were grateful for an extra set. They'd probably be dead before 45 anyway, so just a few would suffice to chew your way through the last years of your life.