Proposal:
Instead of set integers for the rect elements coordinates and height + width sizes I propose setting them to these fix values based on percentages. Have scale only change the SVG head Height and Width and every rect element below will scale based on the parent svg element. I see that the github.com/ajstarks/svgo package only allows integers for the proposed attribute changes so probably have to do some wizardry to get around that.
I'd contribute code wise but unfortunately lack the skillset. For now I just edit it manually in vscode.
Reason:
Allows for dynamically scaling all the rect elements based on the svg elements height/width
Allows for
Example SVG
Example SVG Code
<?xml version="1.0"?>
<!-- Generated by SVGo -->
<svg width="64" height="64"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<rect x="0" y="0" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="12.5%" y="0" width="12.5%" height="12.5%" style="fill:#81836b" />
<rect x="25%" y="0" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="37.5%" y="0" width="12.5%" height="12.5%" style="fill:#070707" />
<rect x="50%" y="0" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="62.5%" y="0" width="12.5%" height="12.5%" style="fill:#d210ac" />
<rect x="75%" y="0" width="12.5%" height="12.5%" style="fill:#81836b" />
<rect x="87.5%" y="0" width="12.5%" height="12.5%" style="fill:#0c0c0c" />
<rect x="0" y="12.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="12.5%" y="12.5%" width="12.5%" height="12.5%" style="fill:#090909" />
<rect x="25%" y="12.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="37.5%" y="12.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="50%" y="12.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="62.5%" y="12.5%" width="12.5%" height="12.5%" style="fill:#070707" />
<rect x="75%" y="12.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="87.5%" y="12.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="0" y="25%" width="12.5%" height="12.5%" style="fill:#0c0c0c" />
<rect x="12.5%" y="25%" width="12.5%" height="12.5%" style="fill:#030303" />
<rect x="25%" y="25%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="37.5%" y="25%" width="12.5%" height="12.5%" style="fill:#82f7ef" />
<rect x="50%" y="25%" width="12.5%" height="12.5%" style="fill:#28f6e9" />
<rect x="62.5%" y="25%" width="12.5%" height="12.5%" style="fill:#0c0c0c" />
<rect x="75%" y="25%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="87.5%" y="25%" width="12.5%" height="12.5%" style="fill:#0c0c0c" />
<rect x="0" y="37.5%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="12.5%" y="37.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="25%" y="37.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="37.5%" y="37.5%" width="12.5%" height="12.5%" style="fill:#28f6e9" />
<rect x="50%" y="37.5%" width="12.5%" height="12.5%" style="fill:#04a9a2" />
<rect x="62.5%" y="37.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="75%" y="37.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="87.5%" y="37.5%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="0" y="50%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="12.5%" y="50%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="25%" y="50%" width="12.5%" height="12.5%" style="fill:#730d5f" />
<rect x="37.5%" y="50%" width="12.5%" height="12.5%" style="fill:#b3b59f" />
<rect x="50%" y="50%" width="12.5%" height="12.5%" style="fill:#abad95" />
<rect x="62.5%" y="50%" width="12.5%" height="12.5%" style="fill:#730d5f" />
<rect x="75%" y="50%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="87.5%" y="50%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="0" y="62.5%" width="12.5%" height="12.5%" style="fill:#81836b" />
<rect x="12.5%" y="62.5%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="25%" y="62.5%" width="12.5%" height="12.5%" style="fill:#a2a58a" />
<rect x="37.5%" y="62.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="50%" y="62.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="62.5%" y="62.5%" width="12.5%" height="12.5%" style="fill:#a2a58a" />
<rect x="75%" y="62.5%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="87.5%" y="62.5%" width="12.5%" height="12.5%" style="fill:#81836b" />
<rect x="0" y="75%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="12.5%" y="75%" width="12.5%" height="12.5%" style="fill:#6c6e57" />
<rect x="25%" y="75%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="37.5%" y="75%" width="12.5%" height="12.5%" style="fill:#a2a58a" />
<rect x="50%" y="75%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="62.5%" y="75%" width="12.5%" height="12.5%" style="fill:#a2a58a" />
<rect x="75%" y="75%" width="12.5%" height="12.5%" style="fill:#6c6e57" />
<rect x="87.5%" y="75%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="0" y="87.5%" width="12.5%" height="12.5%" style="fill:#212834" />
<rect x="12.5%" y="87.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="25%" y="87.5%" width="12.5%" height="12.5%" style="fill:#81836b" />
<rect x="37.5%" y="87.5%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="50%" y="87.5%" width="12.5%" height="12.5%" style="fill:#81836b" />
<rect x="62.5%" y="87.5%" width="12.5%" height="12.5%" style="fill:#909279" />
<rect x="75%" y="87.5%" width="12.5%" height="12.5%" style="fill:#000000" />
<rect x="87.5%" y="87.5%" width="12.5%" height="12.5%" style="fill:#212834" />
</svg>