Change your parameter type to object instead of psobject. That way PowerShell won't try to loop over the contents during validation.
function testme {
param(
[ValidateScript({ $_ -is [array] -or $_ -is [hashtable] })]
[object]$args
)
}