Returning an error on inputs that are too long (for some definition of it) is the way to go.
Reply on news.ycombinator.com