The handling of the track limits thing is a nonsense. We all know that these, the best drivers in the world, can keep the cars in the track limits. Monaco, Baku, Singapore... They all are examples of this skill. If they do make a mistake at these tracks it has serious consequences, at least at most of the corners.
So, notwithstanding Hollus' sig, here's a simple solution. In qualifying and the race the race officials will monitor some corners on a random schedule.
If you are seen to leave the track in qualifying, time deleted.
If you are seen to leave the track in the race you are demoted one place. Slow down till you are passed. If you don't do that in one lap from the instruction, you lose another place, and so on. This stops a driver fighting on to prevent a rival from moving ahead to challenge for the next place up the road.
Place demotions can be applied retrospectively at the end of the race if necessary.
No need for kerbs, grass, gravel or any other inhibitor to off track lines. Stay on the track and you won't be disadvantaged.