neogeo I believe urls used that scheme back in an older beta. You might be able to get inspiration for an extension that would do that by looking at older commits of core (adjusting for recent API changes and finding how to extend those components of course)
Any particular reason to want this url scheme ? If it's for migration purposes just setup redirects and use Flarum's defaults as your new canonical urls. That redirect you would need is even possible to configure with the MigrateToFlarum Redirects extension. But it would probably be even faster to use an Apache or Nginx rule if you're able to.