Anyway libarchive can read rar files so just use bsdtar. It can do many other archive files [0] like cpio as well. One standardized interface for everything is nice
[0] https://github.com/libarchive/libarchive#supported-formats