While I believe fasting is safe your logic is flawed. If I following your logic, what would the answer be to "Is it safe to not brush your teeth or visit the dentist"
It's safe because humans had no access to dental hygiene. Think about it, humans had neither toothbrush or toothpaste. And there where no dentist. Humans had to go through life without proper dental hygiene.
Obviously, not taking good care of your teeth is not a good idea. Even though our ancestors didn't.