Stir the soy sauce, lime juice, hoisin sauce, brown sugar, and cornstarch together in a small bowl. Set this aside.
Cut your block of tofu into triangles. First, slice it into approximately ½-inch thick slabs, then cut each slab in half, to create a square. Cut each square in half on a diagonal to create two triangles (Note 2).
Coat the bottom of a large wok with one tablespoon of the oil and place it over medium heat. Give the oil a minute to heat up. Add the tofu triangles in an even layer. Cook the tofu pieces for about 10 minutes, flipping them halfway through, until they're golden brown on both sides (Note 3). Transfer the cooked tofu pieces to a plate.
Add the remaining oil to the wok, then allow it to heat up for a minute. Add the shallots. Cook the shallots for about 3 minutes, stirring often, until they soften and begin to brown.
Add the garlic and lemongrass to the wok. Stir them in with the shallots and cook the mixture for about a minute, stirring constantly.
Raise the heat to medium-high and add the bell pepper. Stir-fry the ingredients for about 3 minutes, until the pepper brightens in color and becomes tender-crisp.
Return the tofu to the wok, then carefully pour the soy sauce mixture over the tofu. Stir the ingredients up and continue cooking the mixture for about 1 minute, until the sauce thickens slightly and coats the other ingredients.
Stir in the basil and scallions. Continue cooking the mixture for a few seconds, just until the basil wilts, then remove the wok from heat.
Top the stir-fry with chopped peanuts and serve it over rice.