There is, or I should say, was a way to do this: adb backup
Unfortunately, for "security" reasons, nearly every app developer (Google included) opts out of it in the app manifest, completely nerfing the feature. [1]
We live in a truly terrible timeline where the infrastructure to do what the author describes exists and has been there for years, and yet has been made functionally useless by user-hostile policy choices.
Google's incentives are also opposed to allowing users to take an offline backup of their apps and app data, because now they're able to sell more cloud storage for your data.
[1] https://stackoverflow.com/questions/74387730/back-up-android...