For “Shadowslayer” (unlike cards like “Black Tyranno” and “Drillago”), only the Monster Card Zones are looked at. If all of your opponent’s monsters are in Defense Position, then “Shadowslayer” can attack directly even if your opponent has Spell and Trap Cards on the field.
If “Shadowslayer” attacks a face-up Attack Position monster, and the opponent activates “Book of Moon” so that his only monster on the field is now in Defense Position, a replay occurs, because “Shadowslayer” is now able to attack directly.
If all of your opponent’s monsters are in Defense Position but one of them is equipped with “Ring of Magnetism”, “Shadowslayer” cannot attack directly and must attack that monster if it attacks.