Consoles aren't preventing PC games from being coded to the PC, developers have made this problem, and mainly because of how PC gaming has become. Piracy is rife in the PC gaming world so developers latched on to the consoles as it was more difficult to pirate the games, then people started moaning so the developers were like okay fine we will support the PC again and made a few half arsed attempts at ports.
Also consoles have been around longer then Personal Computers so I'm not sure why you've got this image that PC's were the only dominant gaming platform out there at any given time, it's only in the last few years that consoles have actually gotten on par with PC's and I am for one glad for that as I am tired of constantly putting in a flashier graphics card so I'm DX whateva compliant.