Horrible Input Lag in clean project

I started a clean project to work on a game idea some friends and I had. I just reinstalled Windows last month so this is a fresh install of Unity and Visual Studio 2019.

I’m having so many problems I can barely describe them here. I want to make a video and post that but I’ll see how this works first:

When I first installed Unity and created this project, the first thing I noticed was how slow and choppy the entire editor was. Entering text in the name of a file or in any object’s properties made it clear I was getting about 5fps. Eventually after days of searching the internet I found a command line option (-force-opengl) which seemed to make that better.

But now I’ve started setting up some controls for my main (character) object, and they are extremely rudimentary:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Space_ShipController : MonoBehaviour
{
    public float turnAccelerationRate;
    public float accelerationRate;
    private float turnSpeed;
    private Rigidbody2D myBody;

    // Start is called before the first frame update
    void Start()
    {
        turnSpeed = 0;
        myBody = GetComponent<Rigidbody2D>();
    }

    // Update is called once per frame
    void Update()
    {
        //ship rotation
        if (Input.GetAxis("Horizontal") < 0)
        {
            turnSpeed += turnAccelerationRate;
        }
        else if (Input.GetAxis("Horizontal") > 0)
        {
            turnSpeed -= turnAccelerationRate;
        }
        else if (Input.GetKey(KeyCode.Space))
        {
            if (turnSpeed > 0)
                turnSpeed -= turnAccelerationRate;
            else if (turnSpeed < 0)
                turnSpeed += turnAccelerationRate;
        }

        myBody.rotation += turnSpeed;

       
        if (Input.GetAxis("Vertical") < 0)
        {
            myBody.AddForce(transform.forward * accelerationRate, ForceMode2D.Force);
        }
        else
        {
            myBody.AddForce(transform.forward * -accelerationRate, ForceMode2D.Force);
        }
    }
}

When I run the program, pressing any key on the keyboard causes a noticeable frame drop of over 100ms, somewhere slightly below 200ms. Obviously this makes any input cause the game to drop frames.

I’ve also been having problems in Visual Studio 2019. Every time I open a file from the project I am told that I’m targeting the wrong framework, despite having the correct framework installed and selected. I even tried installing this framework (4.7.1) using NuGet for every subproject in the solution. It worked for that session, but then stopped working again.

Sometimes Unity starts to repeatedly fail to load the editor window, and I’m asked to revert to factory settings, which I do, and then I get the same error again in a repeating loop. Then I have to delete files from the appdata folder to get Unity to work again.

Sometimes when I open the script files in VS2019 through Unity, VS2019 starts erroring about about some component not being found (I forget the exact error), and there’s no way to stop it from spamming errors except to force-close it.

What exactly is going on here?

I’m using Windows 10 and have a beefy gaming PC.

I tried completely uninstalling Unity, and then reinstalling it through Visual Studio Installer, and then running a Visual Studio repair operation. Same problems. Is there a certain amount of free space Unity needs on the system drive? Because my C drive is down to about 7 gigs free.