You avoid E.coli by cooking the steak rare to medium rare. It doesn't take much heat to kill bacteria, since it's almost entirely on the surface. It isn't like you're eating it raw or eating chicken.
Ground beef is what you have to cook all the way through, since it's "surface" is everywhere, and the grinding process exposes the meat to all sorts of bacteria.
More importantly, the major cause of food poisoning is not in the food itself, but in the utensils used to cook the food. If you have dirty preparation, the meat will be dirty even if its cooked to the consistency of a car tire.