There are also laws about how fast you can drive to your restaurant and whether you can assault your employees once you get there. Neither of them have a place in a conversation about the efficacy of food safety laws, nor do the building permits you mention. We have different laws to regulate different domains and they exist largely because someone cut corners in the past and people literally died.
> Neither of them have a place in a conversation about the efficacy of food safety laws
They do because these fees are paid to engineers and architects as well as to the local health authority to certify that the restaurant is up to local "health codes", keeping in mind this is pre-lease and pre-construction. They regulate the size of pipes, the potential ventilation, amount of washrooms, amount of sinks, etc... in the name of food safety.
Now that's fine but why do governments get tens of thousands of those fees? There's also no nuance for small-scale operators. And if you buy a defunct restaurant that's already paid those fees, you get to pay them again. Again, these are to comply with "health regulations" and are things that no non-food business needs to pay.