Right now, happiness seems to be an early counterbalance to extreme aggression or expansion, though it could probably do with a bit more influence. If you’re playing properly/balanced, as others have said, it shouldn’t be much of an issue. I have found that after my warring/expansion phase from late Ancient (i.e. once I get Horsemen) to Medieval, I don’t even look at happiness anymore. I haven’t seen any big swings at all, and always have excess. Perhaps I’ve just gotten a build order down such that I can keep all unhappiness sources in check?
As an example, I’m running a Byzantine empire on Immortal, Huge, Epic, 17 Civs, 24 CS, I’m running Progress, Fealty, going into Imperialism, I’m in Late Industrial era, I have 21 cities and I am sitting at 180 happiness. Perhaps my religion helps me shore up weaknesses (Inspiration for keeping boredom down)? Or maybe this is how happiness should be functioning?
As a note, I don’t build so many farms these days. I’m heavy on Lumbermills and villages, since they give balanced yields, but I only improve Luxuries and Strategics until I unlock those. Or build roads. With too many farms I found that my pop outgrew my yields and happiness started to become a factor.