KOTOR 2 had the best written companions in any video game I've played. I will defend the writing in that game
to the death, but the companions especially were well done... with the only exception being the Disciple. But I think he has more dialogue in TSLRCM. I guess Mandalore is pretty weak too but I think the point of that character is that he is one character you can't change in any way - he's already entirely devoted to Revan. Kreia scorns him.
But I'll pick
Kreia and
Visas, Kreia because, well,
Kreia. Visas because there are times when you think the entire game might actually be about her. And while she talks about all the terrible shit that has been done to her, she never asks for your sympathy. Plus, asking her to bring me the Darth Nihilus mask after letting her have her moment of vengeance was one of the most satisfying moments I've had in an RPG.
As for Mass Effect, yes, the companions in these games were done very well.
Garrus is a bro as others have said. He's one of the few who stays with you throughout all three of the games, he's got his head fucking screwed on, and he goes from idealistic to grimdark and I always like seeing that happen in any story.
While we're on Mass Effect I'll also pick
Ashley, to defend her from morons who call her a space racist and have no idea what the fuck they are talking about, and because apparently, people picked Kaiden to survive over her. What the actual fuck?
Gaichu from Shadowrun: Hong Kong. Saved my ass in so many fights but never felt OP (except at the end of the game when every fight is a walkover, of course). And he was so interesting to talk to. I agree with others about
Racter, too. The writing and the companions in the Shadowrun games improved with each new iteration - hope there's more.
Chai Ka from Jade Empire, because allowing an evil spirit free reign to control a little girl's body is
really fun.
Death's Hand, because binding another evil spirit to your will and disgusting half of your other companions in the process was pretty neat. He doesn't say or do much after you bind him, but his armour is fucking cool and that's all that matters.
Black Whirlwind, because even though he's BIOWARE FUNNY, he's fucking amazing with those axes.
Olivier and
Schera from Trails in the Sky. They have genuinely funny dialogue, especially when paired together, without it ever really seeming stupid - definitely not BioWarey. No SJW whines from them either. You learn more about Olivier as the game goes on and he only gets more interesting (and less annoying - I didn't like him at first but he definitely grew on me).
Triss,
Yennefer and
Ciri from The Witcher 3. Reasons should be obvious.
Also,
Dandelion and
Zoltan for being bros. I wish Zoltan had more to do in The Witcher 3.
I'll edit this post and add more from other games as I think of them, but this thread is pretty much
already, many good suggestions here.