Ruby is not the problem at all. The vast majority of time with homebrew is spent doing git operations, downloading tarballs, running makefiles, and the like. You could rewrite the entire thing in Rust and not notice any difference.
The thing that might make a difference is to build some custom infrastructure, so that `brew update` didn't have to do a `git fetch` every time, but instead downloaded the updated formula registry in a more efficient manner. But that's a lot to ask of a project like this.