This Catalyst code is not sensible.
sub xxx : Local Args(0) {
my ($self, $c, $s, $r, $p) = @_;
$c->res->body( wantarray );
}
The arg handling is wrong Args(0) means just that, and there is no way using the return of wantarray could ever make sense as a body. If that is meant to be a stand-in for the void context function you speak about it should not be there but by itself.
sub xxx : Local Args(0) {
my ($self, $c) = @_;
function_in_void_context();
# And should be wrapped in model probably.
# Naked function calls in Cat is code smell.
$c->res->body("Value or none if falling back to template, etc");
}