I don't know. My guess is the taxpayer when it is demanded by the state. Someone may pay for it if it is optional. I don't see how pathologists can make a living doing freebies. I saw only one autopsy that I recall as a medical student, nothing since.
I think if the family requests an autopsy the family should pay.
If the police or gov’t asks I don’t know.
Great questions.