better definition of index_shape

unroll some cases of indices(), sufficient to fix #4672
this should be done the same way as index_shape, but at this time
I'm minimizing changes and possible breakage.