The length of the URL isn't limited, and there shouldn't be any issue with long IDs or slugs character-wise.
There is a limit to the possible IDs though. Flarum by default uses MySQL UNSIGNED INT for the auto-increment ID, which maxes out at 4'294'967'295 according to the MySQL documentation.
If that's not enough, you could alter the database schema to use BIG INT. I know Laravel switched to BIG INTs by default, maybe Flarum will do as well in the future. There's never been anyone close to reaching the limit so there has not been any talk of raising the default increment key size yet.