MAINT: avoid spurious warnings for invalid arguments