How to programmatically delete taxonomies when a module is uninstalled?
I did not test it myself, but as far as I see in the documentation, Term is using Entity::delete(). You might try to load the terms you wish to delete and call this method directly on them:

$term-&gt;delete();