Speaking about this particular silly example, it is, although redundant, is technically safe.
But you have to understand that our code is not always limited to such a spaghetti code example.
- First, in a properly designed application a database interaction is separated from input validation. And a database layer just have no idea whether is sent variable is "safe" or not. As a result, it's just much simpler to treat every single variable as "unsafe" and treat all variable uniformly.
- Second, imagine there is not just a single silly variable, but a dozen of them. How long your code will become?
- if you plan to use different approaches (prepared and non-prepared ) intermixed, it would still make no sense - it will overcomplicate your code for no reason. Why not to use an uniform solution all the time?
Besides, your premises are simply wrong. Prepared statements are not slower.