Instead of going through dumps you can just send the string. That's all dumps is doing anyways and it's slower going through dumps.

``` py
self.response.out.write("invalid")
```