Another solution I have seen in action is to simply have a ckeditor page for each part of the page. I worked for a company that did this. Then in each editor you would insert a variable which embedded that part into the page (a product card on a products page etc)
I am not sure, but I feel Twig might not able to prevent all kinds of command execution in the template. So to make it more secure, is there any other attempt, that we should take?