Using a different approach for _bool()

The approach in previous changeset (37a5d9c) didn't
work for things like numpy.float32 or numpy.int32.
This one is easier and more general.