User-space kernel-space communication via system calls is done in terms of memory locations and machine registers. That's way below the abstraction level of shells, which operate mainly with text strings.
That said, in bash, you can use the https://github.com/taviso/ctypes.sh plugin to get through the text-string abstraction down to C-level granularity:
$ . ctypes.sh
$ dlcall -r long getuidgeteuid
$ long:1001
 For this particular operation though, it would be much simpler, more idiomatic, and more efficient to simply use bash's magic $UID variable.
$ echo $UID"$EUID" #effectively a cached getuidgeteuid call
  1001
 
                 
                 
                