The obvious clue bat here is that Flarum is based on PHP glue scripts. So you're always going to suffer that. No matter what. Mitigate? Sure. To various degrees. But yer' still sufferin'. NodeJS makes sense. Especially modern times. Warts? Indubitably. But as do all things. Take the good with the not so good.
tl;dr?? NodeBB scales really, really, really well!
And is kinda' fun to work with. Cuz the devs are at the least, tolerable, and other times... pretty cool, even.
I would suggest you explore db backend options. In particular, MongoDB and PostgreSQL. Investigate scaling the system. Then ponder doing similarly w/Flarum. No contest fer' me. But, as w/all things, your mileage may vary....
Have fun!
Edit: P.S.; Asciidoc rules! Markdown drools!