Oh yeah a 20g is fine for a 400g ball python. It may seem small but think about it. They stay in their hides 90% of their life. They aren't on the prowl.

A small space is way more suitable for them than a enormous space.