How can I run a shell as a user that has no shell access?

Just run a shell under the user.

sudo -u www bash

The su command takes a shell option (-s), so you can specify which shell to use, allowing you to become the user.

sudo su www -s /bin/bash

The command syntax you're looking for is sudo -u www -s

This will drop you into a shell as the www user even if they don't have a shell normally.