Economic profit
I think there are some problems with the formulation in your question, first you heavily focus on opportunity cost but note accounting profit does not even properly capture all revenue firm gets.
I will first focus on economic profit more broadly and at the end go back to opportunity cost.
Following Varian Microeconomic Analysis pp 24 (emphasis mine),
Economic profit is defined to be the difference between the revenue a firm receives and the costs that it incurs. It is important to understand that all costs must be included in the calculation of profit. …
Both revenues and costs of a firm depend on the actions taken by the firm. These actions may take many forms: actual production activities, purchases of factors, and purchases of advertising are all examples of actions undertaken by a firm. At a rather abstract level, we can imagine that a firm can engage in a large variety of actions such as these. We can write revenue as a function of the level of operations of some $n$ actions, $R(a_1,...,a_n)$, and costs as a function of these same $n$ activity levels, $C(a_1,...,a_n)$.
The above is already rigorous definition for economic profit, economic revenue and economic cost.
Note accounting operates under its own sets of rules. Accounting, is not econometrics. Point of accounting is not to accurately estimate or measure economic relationships. So what you are doing above, defining economic profit at simply accounting profit minus opportunity cost is somewhat misguided (it would only hold in an unrealistic special case where we assume accounting only missed opportunity cost but accounting misses so much more).
First, following Varian we can start with a set of occurring actions $a$ that create revenue and costs. However, when it comes to accounting, not all of these will be reported. For example l, consider selling goods without issuing receipt to avoid paying taxes, which will not get reported as accounting profit. The same holds for many costs other than opportunity cost. For example, consider how depreciation costs are treated by accountants. From purely economic perspective most assets definitely do not depreciate in linear fashion yet accounting allows firms to use linear depreciation for most assets regarding what the true depreciation cost each period is. So the accounting depreciation costs will too be different from economic depreciation cost. Or consider the fact that many countries allow small business to just in their accounting declare portion of their profit as cost without actually even proving they actually incurred these costs (this is done in some countries to ease administrative burden for sole traders and similar one person businesses).
Consequently, it makes more sense to rather define accounting profit in terms of economic profit and then work backwards by inverting those functions if you would want to get back to economic profit from accounting one.
Call $A=(a_1,...,a_n)$. set of all economic actions that actually occur, and $R(A)$ would be economic revenue from those activities. Now apply some function $\rho$ which tells you based on $R(A)$ what actually accounting revenue is.
So accounting revenue $R_{acc}$ would be:
$$R_{acc}= \rho(R(A))$$
Similarly accounting cost $C_{acc}$, we will have actual economic cost firm incurs $C$ based on set of actions it takes $A$ and then we will have some function gamma that tells us what enters into accounting and what not so we would have that
$$C_{acc} = \gamma (C(A))$$
Finally the accounting profit would be difference between the above so:
$$\Pi_{acc} = \rho(R(A)) -\gamma (C(A))$$
Note what $\rho(.)$ and $\gamma(.)$ are will depend on local accounting regulations and laws. in some country government could declare that any firm has to put always just 1000€ as their cost (yes it is unrealistic example but I am just showing it to prove a point) and in such case $\gamma(C(A))=1000$ regardless of anything that happens.
Whereas the true economic profit would just difference between economic revenues and economic costs:
$$\pi=R(A)-C(A)$$.
If you would want work your way back from accounting definitions then you could use inverse functions and economic profit calculated from accounting one would be:
$$\pi= \rho^{-1}-\gamma^{-1}$$.
Note the above does not really require definition of opportunity cost since here simply the function $C(A)$ is just some function where we assume that $C(A)$ assigns true economic cost to every action $a_1,…,a_n$, for standard profit optimization it’s completely okay to treat $C(.)$ as a black box and thus you will not really require separate definition of opportunity cost. As a matter of fact note in situation where there are no alternatives like having mana (from the biblical story where it could only be immediately consumed not stored or used for anything else) opportunity cost would not even be part of $C$ but still there would be distinction and disconnect between accounting and economic profit.
For example if we have $C(A)=c_1 a_1+c_2 a_2… c_n a_n$ and if we define $C$ as a function that always assigns true economic cost then you definition $c_1$ includes all economic costs including opportunity cost, but the economic profit, economic revenue and economic costs are still rigorously defined (even if the constituents of costs such as opportunity costs aren’t).
opportunity cost
Next tackling the opportunity cost separately (which can be later used to build function $C$), good places to start are Buchanan (1987) or Alchian (1968). The authors do not necessarily derive rigorous opportunity cost functions but give rigorous verbal definitions on which we can build.
For example, according by to Buchanan (1987) :
Opportunity cost is the anticipated value of 'that which might be' if choice were made differently. Note that it is not the value of 'that which might have been' without the qualifying reference to choice. In the absence of choice, it may be sometimes meaningful to discuss values of events that might have occurred but did not. It is not meaningful to define these values as opportunity costs, since the alternative scenario does not represent a lost or sacrificed opportunity. Once this basic relationship between choice and opportunity cost is acknowledged, several implications follow.
First, if choice is made among separately valued options, someone must do the choosing. That is to say, a chooser is required, a person who decides. From this the second implication emerges. The value placed on the option that is not chosen, the opportunity cost, must be that value that exists in the mind of the individual who chooses. It can find no other location. Hence, cost must be borne exclusively by the chooser; it can be shifted to no one else. A third necessary consequence is that opportunity cost must be subjective. It is within the mind of the chooser, and it cannot be objectified or measured by anyone external to the chooser. It cannot be readily translated into a resource, commodity, or money dimension. Fourth, opportunity cost exists only at the moment of decision when choice is made. It vanishes immediately thereafter. From this it follows that cost can never be realized; that which is rejected can never be enjoyed.
since the opportunity cost is the value of the next best alternative you can rigorously define as follows.
Suppose that for each action that actually was taken in the set $A=a_1,…,a_n$, there are alternative sets of alternative actions (e.g. each $a_i$, has some alternative $b_i$, $z_i$ and so on, and let’s assume that all the other alternatives are mutually exclusive with $a$. Well then opportunity cost of each action $a$ is just value of the next best alternative so if we have that:
$a_i\succ b_i \succ z_i … $
Then opportunity cost will simply be $V(b_1)$ where $V$ is simply just some function that assigns monetary value (or in consumer problem utility to $b_i$).
If you want to then put this value into profit function explicitly then simply the cost function will be some composite function given by $C(a_i, V(b_i))$ (note this is ultimately just function of $a_i$ because the next best alternative necessarily depends on what you choose as $a_i$, so in the end it’s just more complex way of writing $C(a_1))$
I think the above is rigorous even though it’s very simple (of course perhaps the notation I use could be made more precise).