I browsed Twitter without an account at the time and I don't remember this being the case; there wasn't a way to exit the login flow. These[0][1] Reddit thread seems to confirm that.
[0]https://www.reddit.com/r/Twitter/comments/sno1md/login_deman...
[1]https://www.reddit.com/r/assholedesign/comments/sod9ej/twitt...