Thanks for the replies!
I know it's possible to do in other languages. I have a python example but since it's a bit of a pain currently to import non-standard libraries I was hoping just to use JavaScript. But now that I think of it I may just create an action to do the encoding in whatever language makes it the easiest and return the value, then reference this action in a main JavaScript action. After testing this, it appears you can't call actions that are written in a different language. It's possible to do this in a workflow, but not an action.
The root of my question really came from the btoa function that populates in the Orchestrator intellisense. It appears to be available, but maybe not usable. See image below:
