Gritty Fantasy Game?
The mechanics of a game reinforce the tone in a lot of important ways. A game like D&D has a hard time carrying a gritty tone because the PCs are very empowered - they can easily overcome their opposition, they recover quickly from injury, and aren't challenged by the situations that create a gritty tone.
Played straight, the system can actively subvert the tone you are trying to establish. Trying to create a game of intrigue and distrust? Cast Zone of Truth. Trying to create a game of harsh survivalism and scrambling for resources? Play a Ranger with Goodberry. Trying to create a game where the world is threatened by a deadly plague that strikes without warning? Paladin spends 5 HP from his Lay On Hands allotment.
Sure, you can build your setting and then rapidly gut out all the mechanical "fixes" for it, but you're cutting against the grain just for the sake of cutting against the grain.
Other systems reinforce gritty tone. Burning Wheel, for example, creates (relatively) weak starting characters who have to fail in the process of pursuing growth and change. The game's fundamentals focus on deeply personal struggles and the cost and benefits of compromise, rather than on the grand, overarching sweep of high adventure.
Warhammer Fantasy RPG (Green Ronin's 2nd edition, as I've played it) reinforces your characters' low stations and mortality, using a deadly combat system and starting your characters into relative material poverty, while presenting you with clear and discrete steps you can take to grow from a Servant or Farmer (literally starting classes in WFRPG) to a renowned Assassin or Master Wizard. All the while showing that vast gulf between your character and what might be his dreams (or his destiny!) will require some real blood, sweat, and tears to bridge. And sometimes, you'll get sidetracked on the way. Or just killed by a lucky Goblin. You're encouraged to start small, dream big, but are constantly presented with the harsh realities of life in its unfair universe.
In both the systems above, high powered characters can really rock the setting to its core, but they still have plenty to fear. There's work involved in getting to where they sit, and there's work involved in staying there. They aren't guaranteed to get to level 20 just by showing up and making most of their saving throws. They've, pardon my english, seen some shit.
A 6-lifepath game of Burning Wheel or a 1200 (2-3 career) XP game of WFRP will provide you with characters that will meet your criteria easily - characters who are colorful and diverse, who have their own history and their own idiosyncracies, but they haev enough power to start standing on their own merits and actually changing the larger world around them through their own mettle. The Warhammer world is much more defined than the setting of Burning Wheel (or D&D), but there's still plenty of wilderness and frontiers of plot to explore.
Using D&D at that power level creates characters with virtual impunity over their environment. Characters don't really struggle unless faced with increasingly big and bad monsters, meaning that a lot of the truly existential questions of what makes a dark, grim, gritty game/setting go out the window, or take on Exalted-level meta-questions (You have all this power to do as thou wilt, now what?)
However, if you're looking for a game that is "grim and gritty" in that 40k fashion, where it's just spikes, decapitations, and high body count, well, D&D would probably work with that.
This message was last edited by the user at 23:00, Sun 08 Apr 2018.