I implemented this with a "[dir=rtl]" in front of every RTL change in the new template here
https://github.com/splitbrain/dokuwiki/commit/5e5582cecaa7271e3ab1c69c898f9ce0ac383291 and here
https://github.com/splitbrain/dokuwiki/commit/49e5a707012739fbb9dc8ee53daaa3784c9a0fc1
This doesn't require a change in the core, but just template authors to use a different technique and not use the rtl mode anymore.