No, optimizing has nothing to do with leverage. It affects entry and exit points, not the trade volume.

Z3 does not use OptimalF. But I would in this case indeed remove the overweight XAU completely from the portfolio. Use the exclude setting in Z.ini for this.