Revive `_gen_case` approach
Revive `_gen_case` approach

It newly fixes `__str__` of parameterized class by partially reverting
the commit 108fa46d10b81ddf0446540d0bdfac7aeb48d039 that caused the
binding issues, two of which are fixed later by
630a2da1cd1b619560dcec015d6bbf9a345e537e and #6287.

hvy/chainer,niboshi/chainer,wkentaro/chainer,chainer/chainer,wkentaro/chainer,hvy/chainer,niboshi/chainer,chainer/chainer,hvy/chainer,chainer/chainer,wkentaro/chainer,chainer/chainer,wkentaro/chainer,niboshi/chainer,hvy/chainer,niboshi/chainer,pfnet/chainer