No, it's not possible to prevent SQL injection as you have just demonstrated in your code (now edited to include proper string formatting). It is going to be very difficult to abuse this vulnerability though. However, I see no reason why you are even considering this. Why not use prepared statements?
The only safe way is to never allow any variable input that is not whitelisted in the query. This means that all data parts should be parameterized and bound using prepared statements. Dynamic SQL query parts need to be constants, hardcoded string literals, or properly whitelisted.
You can't prevent SQL injection 100% as this is a programmer error. There will always be a junior developer that will concatenate a variable directly into SQL. Base64 is not a preventive measure against SQL injection. It's a nasty workaround, but if you have developers that are allowed to make mistakes and put variables in SQL, then you will have developers that also forget to Base64 encode strings. Adding this extra step would just make it easier to introduce SQL injection.