Can I shorten the URL?
If you use in a link
/topic/1234works equally as normal. You should avoid removing the topic name from the actual page url because of SEO.
I think, changing the core (or maybe coding a plugin ?) you can do
/topic/1234, you just need to change the routes, but it is not suggested to change the core
If your end goal was to create shortlinks for easier social media, etc., distribution you may be interested in a thread I created some time ago in which I ended up creating short links with the YOURLS short link system.
If you are curious, this is the thread: https://community.nodebb.org/topic/9712/post-tools-how-to-add-a-new-item