I worked up a little python module that does this, and a few other administrative tasks, for me. It uses httplib, urllib to communicate with REST, json module to understand responses, time module to keep up with token validity, and ConfigParser module to handle a local config file for server names etc.The bulk of the addUser function is:
params = urllib.urlencode({'f':'json', 'token':_token.get('token'), 'username' : uname, 'password': upwd})
headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}
conn = httplib.HTTPConnection(i.get('s'))
conn.request("POST", "/arcgis/admin/security/users/add", params, headers)
response = conn.getresponse()
s = response.read()
data = json.loads(s)
_responses.append({"server":i.get('s'),"result":data})