Press excess moisture out of the tofu using either paper towels or a kitchen towel. Slice into 1 inch cubes and place in a large bowl. Toss with cornstarch until tofu is well coated.
Combine soy sauce, sugar, black pepper, and ginger in a small bowl or glass measuring cup; stir with a whisk. Set aside.
Heat 2 Tbsp. of the oil in a large skillet over medium-high. Add tofu; cook for 7 to 8 minutes, turning to brown all sides, until golden-brown and crisp. Transfer tofu to a plate and reduce heat to medium.
Add remaining 1 Tbsp. oil to pan, along with garlic, shallots, and chile (if using); cook 2 minutes, stirring often, until aromatic.
Add tofu back to pan, along with black pepper sauce and green onions; cook 1 to 2 minutes, tossing often, until the sauce fully coats tofu.
Serve over rice and garnish with fresh basil and any vegetable of your choice (will not be provided