Deleting a user is very easy (@Value(URL)/sharing/rest/community/users/$(username)/delete?f=json). Creating a user is not as simple.
I am also going to say that some of us have already built a lot of transformers in the Esri space. There are quite a few that are free on the hub (I have a few up there), but I have heaps that our business doesn’t want to provide freely, but certainly would be cheaper than building yourself (considering all the error checking, etc)….like deleting a user in ArcGIS Online or Enterprise