test = $toNativeArray($kindUint8, [42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ... more zeros here */, 0, 0, 0, 0]);
For excessively large arrays the compiler will simply run out of memory and crash. For smaller arrays it may be able to generate the code, but the output would be unnecessarily large. It will be much more efficient (both in output and runtime performance) to pass non-zero elements and the length, and let the runtime handle zeros.