DBU (1,8-diazabicyclo[5.4.0]undec-7-ene), a polarity switchable solvent, has been recognized as a green solvent for oil extraction and as a promising catalyst for transesterification. This paper proposes a novel method that combines the dual functions of DBU in direct transesterification. The effects of reaction parameters on the direct transesterification of black soldier fly larvae with methanol when using DBU as both a catalyst and solvent were investigated, and a 96.2% biodiesel yield was achieved at a DBU-to-biomass ratio of 16:1 (mL/g), methanol-to-biomass ratio of 8:1 (mL/g), temperature of 110 °C, and reaction time of 60 min. Remarkably, because of its polarity reversibility, DBU was easily separated and recovered from the reaction solution through phase separation and could be repeatedly used up to 10 times without a considerable loss of catalytic activity. DBU-catalyzed direct transesterification is a green, promising, and cost-effective approach for biodiesel preparation.