I'm going to be honest, I don't remember exactly what I was trying to do here but I stumbled on a solution earlier this week and noticed no one had responded to this question, so I'll post my answer for completeness.
The easiest way I've to do this is with `AiNodeDeclare()` (https://docs.arnoldrenderer.com/api/arnold-7.1.2.0/group__ai__nodes.html#gad6d046358c6879a4df2059471...). For example, if you wanted to add a guid tag to a node for some reason, you can declare a custom value and access it like any other attribute of AtNode.
from arnold import *
import uuid
mesh = AiNode("polymesh")
AiNodeDeclare(mesh, "my_custom_string", "constant STRING")
AiNodeSetStr(mesh, "my_custom_string", uuid.uuid4().hex)
print(AiNodeGetStr(mesh, "my_custom_string")) # returns UUID string