You can convert a String to RawArray using the to_ascii or to_utf8 methods of String, and you can convert RawArray to String using the get_string_from_ascii and get_string_from_utf8 methods of RawArray.
There is no built-in way to convert between int and RawArray. You could calculate the bytes manually but it would be exceptionally inefficient because you will be doing heavy arithmetic in GDScript.
Converting to string is already fine, because there I only convert the string to int, thank you.