Oh i didn´t even know about that fact hah. Good to know. I dont know about Python but on Java you could probably do something like that do only clear the data
private void clearData() {
try {
// Clear data
Runtime runtime = Runtime.getRuntime();
runtime.exec("pm clear YOUR_APP_PACKAGE");
} catch (Exception e) {
e.printStackTrace();
}
}