I thought extension cords were only illegal to use as permanent setup in public buildings, but were ok in homes? Though personally I like to avoid them if I can but if I have to, I use a 12 or 14 awg one, that way it matches the inwall wiring.
In most cases though if I know I'll always have something plugged there, I just install a plug, just for the aesthetic purpose of not having a cord going across a section of the room.
Just do it right and wire up a receptacle behind the TV. It's easy to do, especially if you have an outlet directly below where the TV is mounted. Just get some 10/3 cable from home depot and piggy back off the existing outlet. Punch a hole in the wall behind the TV and just run the wire up the wall cavity to a new outlet.
If you are using a real slim wall mount, you can get a recessed outlet or structured media center. Also, wire up an HDMI wall plate next to it rather than having cables hanging out of the wall.
Do it right. It'll add value to the house if it's wired in nicely. There's no excuse for having cords hanging down, everyone who sees it will think to themselves why you didn't hard wire it. You'll thank yourself in the long run.