PERF: vectorize _spec_to_array_indices, for 3-4x speedup