If you're looking a PHP code based approach there is a SASS (SCSS) PHP package for compiling SASS available at https://scssphp.github.io/scssphp/. It provides a CLI command also, but it's main approach is to be used to compile on the fly. I opted for this approach in a custom theme project where I wanted to use SCSS. Of course I don't want to compile SCSS on every page load, so what I did was setup a custom page template page-compile.php in the theme, and in that I run the compiler. The output is then enqueued just like any normal CSS file. Whenever we want to recompile, just land on /compile and it runs and updates all the CSS. In production maybe we will start using CLI build instead.
Another approach I thought about but never researched was to find a compiler tool and use it. There are probably dozens of options. As far as relevance to the original question, like a lot of questions about WordPress theme development it's just important to remember that while WP itself doesn't provide a direct support for this you can use any tools you want to create the output CSS and as long as you do that, your able to write SASS code and end up with it enqueued as regular CSS in your WP theme.
Because I like working with PHP (my old friend PHP) I just prefer rather than a build process to have a compiler with PHP process because it feels more familiar to me and the setup is just a few lines, and if anything goes wrong at a PHP level I know how to debug it easily. Build processes always leave me feeling uncertain if they break, I don't know really know how they work under the hood.