Just my 2 cents here.
Example 1: Running alone, you approach a corner. A) If you want to make sure you stay on track, you brake early, reduce speed to slightly below "safe speed" and make it. B) If you're going for it, you brake late, reduce speed to the max speed possible for the corner and hope for the best. Sometimes you make it, sometimes you run wide. You stay on the throttle regardless. Case B will always be faster than case A.
While in a corner we're constantly assessing where we're going to exit in relation to the corner. Those times you're clenching your teeth when you're not sure if you're going to make it because maybe you cant see the exit, or you braked too late, you will do only 1 thing 9 times out of 10. Brake some more. You might leave it too late or the corner might tighten up and run wide regardless, in which case 2 things will happen. 1. You'll be far off the racing line. 2. You'd be going way slower than race pace. This would be a mistake which can happen to anyone while they are, as you say "going for it" No professional race car driver will just stay on the throttle regardless. They will make corrections.
Example 2: Car A and car B battling approach corner #1. Car B brakes too late, runs deeper and blocks car A so car A is forced to slow down even more than it would need to make the corner. Car B runs wide on exit, never lifts and comes out ahead. Now car A is stuck behind the slower car B, eventually finds a way around car B on track, only to be passed in corner #1 again the same way.
In this case unless there is quite a large runoff area for Car B to stay on the throttle and get back on the racing line before the next corner without braking, IE Nurburgring GP/F Turn 4 Car B would brake before it hit barriers or ran off track and slow down now wide of the racing line. Car A in this case since it is slower simply takes the inside lane and "criss crosses" to maintain position or gain the advantage before the next corner, all the while being in a better position to maintain the racing line.
My point is as soon as you are off the racing line, if there is not alot of runoff before the next corner you're not going to run faster than people maintaining the racing line. So it's really up to race stewards to watch and decide whether or not a driver did run wide to gain an advantage, albeit small, or if it was purely a mistake and no advantage was gained. That said I ran wide whenever my tyres were run down all to no advantage. Mistakes can be made and no penalties should be given for them. They should only be penalised if an advantage was gained.
EDIT: From the Regulations
Track Contact
"In a situation where the driver goes off the track, and without prejudice to part (e) below, he may rejoin, only when it is safe and without gaining any advantage. Also, if a driver unintentionally or intentionally leaves the track and gains a spot, he must relinquish that spot or he will be penalized.
e) Drivers committing serious mistakes repeatedly or seem to have a problem with keeping the car on the track would be reported to the Stewards and could result in penalties."
From my understanding of this it's perfectly fine to run wide here and there as long as it doesn't happen every lap and as long as you don't gain anything.