Description of issue
Our code is using a pattern like the following:
waveform_array_array = array.array("d", [0] * waveform_array_size)
While discussing #1997 , we discovered that it's much more efficent to allocate the array as follows (especially for large arrays):
waveform_array_array = array.array("d", [0]) * waveform_array_size
We should update all array allocations in the repo to follow this pattern. This affects multiple APIs.