I was wondering if there was a way to create an instance without a Key-Pair for testing purposes.
You can create an instannce without keypair however you will not be able to ssh into it or you can start it with ssm agent installed and running and use ec2 ssm service to send shell commands.
Boto3 Create Instance without a Key-Pair