Hello,
In general, we recommend the unused pins as output low. For unused GPIO it is recommended the following:
Do not connect unused I/O pins to anything. Make it floating, and then set it as output low in software. Periodically refresh the state of the pin to avoid changes in state by noise. If floating pins are not allowed in a particular application, connect a 10kΩ pulldown resistor for each unused pin. Do not connect any unused I/O pin to power or ground directly.
There has a useful application note for you reference:
https://www.nxp.com/docs/en/application-note/AN4779.pdf