Consider Mastodon as an example - basically open source Twitter. Tweets can be up to 500 characters long. Of course, since it's open source, you can modify it to allow longer tweets. Unmodified Mastodon can connect to other copies of Mastodon, including modified ones. Mastodon will accept long tweets from other servers and display them to users, so I call this a "soft" limit.
My question is about hard limits. If an application like Mastodon would enforce a strict length limit on tweets, as well as the number of replies displayed under a tweet, and the length of usernames, and the number of users a user can follow, and so on, we could calculate the worst-case memory usage and processing time of any request. Then, we could calculate the worst-case requests per second of our server, as well as RPS under some reasonable conditions (average-length tweets, different request mixes, etc) and thus prove we've met our performance requirements. Of course, if performance is really important, we'll then add a safety factor.
Even though compile-time memory calculation is overkill for a Twitter clone, having well-defined hard limits still allows us to know what the worst-case input is, and then give the application that input and measure the resources needed to process it.
Is it a good idea to set limits across the codebase to ensure predictable resource usage, or is it a waste of development effort and a pile of unnecessary limitations for users?