Based on the current design of Cantor, I don't think that there is a way to do this. When the Sage notebook receives the input from a cell, it checks to see if there are any "%" commands a the top. Then, depending on which system is specified, it does something different. With Cantor, when you choose the Sage backend, it starts up a Sage process and sends all of the input directly to Sage. I though your example with cython("""...""") is the best you can do based on the current architecture of Cantor.