The Government plans to put existing guidance on rape myths into law, requiring judges to address harmful assumptions in sexual offence cases unless a warning is unnecessary.