Ok i'm stepping into this ring and the gloves are coming off!
Shadow is the most developed Sonic character to exist within the series, he is a much better developed character than Sonic in actual fact! And Sonic is the title character! Shadow uses the persona of being angsty and cold-hearted to hide the fact that he cares about those around him, the rest of Team Dark especially. He had to understand the reality of death just mere weeks after being braught into the world, so it's no surprise he acts like he does, it was practically his first impression on life. Shadow also has to deal with the fact that he is immortal, he will have to slowly watch his friends grow old and die off until he is all alone again because of his immortality, and that's if nothing ever happens to any of them before that! Shadow cannot die, as the Ultimate Lifeform he both never ages and his body is practically indestructible, i mean look at the comics, BULLETS BOUNCE OFF OF HIM! I know that this is never explored but Sonic must at least adknowledge the fact that Shadow will be there for Earth and everyone on it when he himself is long gone, and if Sonic trusts Shadow enough to allow him to roam free despite knowing Shadow will live until the end of time, that proves that Shadow does indeed have friends and at some point bonded with the others. Yes Shadow is immortal, but if Sonic didn't trust him he's not gonna let him be around when he isn't, get what i'm saying? He'd find some way to trap him in containment. And if Sonic knows that, that means that the duo truly are friends and not just rivals, because Shadow would have to prove that he is capable of staying good and protecting the world when Sonic isn't around. Yes Shadow can be a douche, but if Shadow can put that past of his behind; move on, make new friends, and actually be sincerely good hearted, this proves that he is indeed the most complex and developed Sonic character. You can glance him and say he's a 'Dark Sonic', but if you truly look at him and his story you'll find that he is ultimately (Pun not intended) the best character in the series. If SEGA took the time to flesh out the characters in the same way they have Shadow, it's highly likely that many other characters could be better at being characters than he is, but that ain't happening any time soon.
Boom Shadow is just a d****e though...