South Korea's president has suggested Seoul could supply weapons to Kyiv, marking a major foreign policy shift.